34 #include "lpc43xx_dualcore_config.h"
69 #define SIGNATURE_M4_MAGIC 0xF00D4BAD
70 #define SIGNATURE_M0_MAGIC 0xBEEFF00D
77 #define EX_BLINKY (1 << 0)
78 #define EX_USBHOST (1 << 1)
79 #define EX_USBDEV (1 << 2)
80 #define EX_LWIP (1 << 3)
81 #define EX_EMWIN (1 << 4)
84 #define OS_SIGNATURE 3
85 #elif defined(OS_FREE_RTOS)
86 #define OS_SIGNATURE 2
88 #define OS_SIGNATURE 1
91 #ifndef EXAMPLE_BLINKY
92 #define EXAMPLE_BLINKY 0
95 #define EXAMPLE_BLINKY EX_BLINKY
98 #ifndef EXAMPLE_USB_HOST
99 #define EXAMPLE_USB_HOST 0
101 #undef EXAMPLE_USB_HOST
102 #define EXAMPLE_USB_HOST EX_USBHOST
105 #ifndef EXAMPLE_USB_DEVICE
106 #define EXAMPLE_USB_DEVICE 0
108 #undef EXAMPLE_USB_DEVICE
109 #define EXAMPLE_USB_DEVICE EX_USBDEV
113 #define EXAMPLE_LWIP 0
116 #define EXAMPLE_LWIP EX_LWIP
119 #ifndef EXAMPLE_EMWIN
120 #define EXAMPLE_EMWIN 0
123 #define EXAMPLE_EMWIN EX_EMWIN
126 #define EXAMPLES_INCLUDED (EXAMPLE_BLINKY + EXAMPLE_LWIP + EXAMPLE_USB_HOST + \
127 EXAMPLE_USB_DEVICE + EXAMPLE_EMWIN)
144 static const struct image_sig __M4Signature = {
178 int32_t cnt = 60000 / (msec * 2);
179 DEBUGSTR(
"ERROR: Boot failure!!\r\n");
189 static void print_image_info(
const char *pre,
const struct image_sig *img)
191 DEBUGSTR(
"***************************************\r\n");
192 DEBUGOUT(
"%s: Header found at %p\r\n", pre, img);
193 DEBUGOUT(
"%s: Included Examples: %s%s%s%s%s\r\n", pre,
199 DEBUGOUT(
"%s: OS Used: %s\r\n", pre,
200 img->
os == 1 ?
"NONE (STANDALONE)" :
201 (img->
os == 2 ?
"FreeRTOS" :
"UCOS-III"));
202 DEBUGOUT(
"%s: Built on %s %s\r\n", pre,
205 DEBUGSTR(
"***************************************\r\n");
217 if (*addr != 0xAA55DEAD) {
218 DEBUGOUT(
"ERROR: Unable to find signature1 of M0 Image at %p\r\n",
220 booting_m0_failure(20);
226 if ((image_addr & 0xFFF00000UL) != (*addr & 0xFFF00000UL)) {
227 DEBUGOUT(
"ERROR: M0 Image at 0x%08X, Infostruct at "
228 "0x%08X not is same region\r\n", image_addr, *addr);
229 booting_m0_failure(20);
236 DEBUGSTR(
"M0_IMAGE: ERROR: M0 image signature 2 not found!\r\n");
237 booting_m0_failure(20);
243 DEBUGSTR(
"M0_IMAGE: ERROR: M4 image signature 2 not found!\r\n");
244 booting_m0_failure(10000);
247 print_image_info(
"M0_IMAGE", m0);
248 print_image_info(
"M4_IMAGE", m4);
257 DEBUGSTR(
"ERROR: Running USB Host/Device stack on both"
258 " cores is not supported yet!\r\n");
259 booting_m0_failure(2000);
264 DEBUGSTR(
"ERROR: Running lwIP on both core is not supported!\r\n");
265 booting_m0_failure(2000);
270 DEBUGSTR(
"ERROR: Running emWIN on both core is not supported!\r\n");
271 booting_m0_failure(2000);
288 if (m0_image_addr & 0xFFF) {
293 if (CheckImages(m0_image_addr, &__M4Signature) != 0) {
303 Chip_CREG_SetM0AppMemMap(m0_image_addr);