Midnight Sun Firmware
Loading...
Searching...
No Matches
bootstrap.h
1#pragma once
2
3/************************************************************************************************
4 * @file bootstrap.h
5 *
6 * @brief Header file for bootstrap application
7 *
8 * @date 2025-09-12
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11
12/* Standard library Headers */
13#include <stdint.h>
14#include <string.h>
15
16/* Inter-component Headers */
17#include "midFS.h"
18#include "status.h"
19/* Intra-component Headers */
20
27#define BOOTLOADER_ADDR 0x08008000
28#define BOOTLOADER_SIZE 0x00007000 // 64 KB
29#define APPLICATION_ADDR 0x08018000
30#define CRC_FILE_PATH "crc.txt"
31#define CRC_SIZE 8
32#define CRC32_POLY 0xEDB88320UL // Reversed 0x04C11DB7
33
34extern uint32_t crc32_table[256];
35
36typedef void (*EntryPoint)(void);
37
42void jump_to(uint32_t addr);
43
48void crc32_init(void);
49
54void compute_crc32(const uint8_t *data, size_t length, uint32_t *crc_dest);
55
60StatusCode read_crc32(const char *file_path, size_t length, uint8_t *crc_dest);
61
66void bootstrap_main(void);
StatusCode
StatusCodes for various errors.
Definition: status.h:27
void compute_crc32(const uint8_t *data, size_t length, uint32_t *crc_dest)
Definition: bootstrap.c:42
StatusCode read_crc32(const char *file_path, size_t length, uint8_t *crc_dest)
Definition: bootstrap.c:53
void jump_to(uint32_t addr)
Definition: bootstrap.c:19
void crc32_init(void)
Definition: bootstrap.c:28
void bootstrap_main(void)
Definition: bootstrap.c:57