34 #include "lpc43xx_dualcore_config.h"
54 #define SIGNATURE_M4_MAGIC 0xF00D4BAD
55 #define SIGNATURE_M0_MAGIC 0xBEEFF00D
62 #define EX_BLINKY (1 << 0)
63 #define EX_USBHOST (1 << 1)
64 #define EX_USBDEV (1 << 2)
65 #define EX_LWIP (1 << 3)
66 #define EX_EMWIN (1 << 4)
69 #define OS_SIGNATURE 3
70 #elif defined(OS_FREE_RTOS)
71 #define OS_SIGNATURE 2
73 #define OS_SIGNATURE 1
76 #ifndef EXAMPLE_BLINKY
77 #define EXAMPLE_BLINKY 0
80 #define EXAMPLE_BLINKY EX_BLINKY
83 #ifndef EXAMPLE_USB_HOST
84 #define EXAMPLE_USB_HOST 0
86 #undef EXAMPLE_USB_HOST
87 #define EXAMPLE_USB_HOST EX_USBHOST
90 #ifndef EXAMPLE_USB_DEVICE
91 #define EXAMPLE_USB_DEVICE 0
93 #undef EXAMPLE_USB_DEVICE
94 #define EXAMPLE_USB_DEVICE EX_USBDEV
98 #define EXAMPLE_LWIP 0
101 #define EXAMPLE_LWIP EX_LWIP
104 #ifndef EXAMPLE_EMWIN
105 #define EXAMPLE_EMWIN 0
108 #define EXAMPLE_EMWIN EX_EMWIN
111 #define EXAMPLES_INCLUDED (EXAMPLE_BLINKY + EXAMPLE_LWIP + EXAMPLE_USB_HOST + \
112 EXAMPLE_USB_DEVICE + EXAMPLE_EMWIN)
129 static const struct image_sig __M4Signature = {
163 int32_t cnt = 60000 / (msec * 2);
164 DEBUGSTR(
"ERROR: Boot failure!!\r\n");
174 static void print_image_info(
const char *pre,
const struct image_sig *img)
176 DEBUGSTR(
"***************************************\r\n");
177 DEBUGOUT(
"%s: Header found at %p\r\n", pre, img);
178 DEBUGOUT(
"%s: Included Examples: %s%s%s%s%s\r\n", pre,
184 DEBUGOUT(
"%s: OS Used: %s\r\n", pre,
185 img->
os == 1 ?
"NONE (STANDALONE)" :
186 (img->
os == 2 ?
"FreeRTOS" :
"UCOS-III"));
187 DEBUGOUT(
"%s: Built on %s %s\r\n", pre,
190 DEBUGSTR(
"***************************************\r\n");
202 if (*addr != 0xAA55DEAD) {
203 DEBUGOUT(
"ERROR: Unable to find signature1 of M0 Image at %p\r\n",
205 booting_m0_failure(20);
211 if ((image_addr & 0xFFF00000UL) != (*addr & 0xFFF00000UL)) {
212 DEBUGOUT(
"ERROR: M0 Image at 0x%08X, Infostruct at "
213 "0x%08X not is same region\r\n", image_addr, *addr);
214 booting_m0_failure(20);
221 DEBUGSTR(
"M0_IMAGE: ERROR: M0 image signature 2 not found!\r\n");
222 booting_m0_failure(20);
228 DEBUGSTR(
"M0_IMAGE: ERROR: M4 image signature 2 not found!\r\n");
229 booting_m0_failure(10000);
232 print_image_info(
"M0_IMAGE", m0);
233 print_image_info(
"M4_IMAGE", m4);
242 DEBUGSTR(
"ERROR: Running USB Host/Device stack on both"
243 " cores is not supported yet!\r\n");
244 booting_m0_failure(2000);
249 DEBUGSTR(
"ERROR: Running lwIP on both core is not supported!\r\n");
250 booting_m0_failure(2000);
255 DEBUGSTR(
"ERROR: Running emWIN on both core is not supported!\r\n");
256 booting_m0_failure(2000);
273 if (m0_image_addr & 0xFFF) {
278 if (CheckImages(m0_image_addr, &__M4Signature) != 0) {
288 Chip_CREG_SetM0AppMemMap(m0_image_addr);