Ethernet Bootloader -> PSOC 5 -> Problem starting Userapp | Cypress Semiconductor
Ethernet Bootloader -> PSOC 5 -> Problem starting Userapp
I'm trying to write a ethernet bootloader. Thanks to Bob Marlowe, I was able to flash the PSOC5 successfully ;).
Now I flashed a "blinky led"-program using the ethernet bootloader, but unfortunately, it doesn't "run".
Attached is the blinky led, which works as a standalone program (starting @0x00000000). Afterwards I changed in the linker script (cm3gcc.ld) the following lines, as the bootable app start's at 0x6400 in flash. (but before generated the project)
Line 25: rom (rx) : ORIGIN = 0x6400, LENGTH = (262144 - 0x6400)
Line 65: ASSERT(0x6400 + . <= 0x10000 || !1, "DMA Init must be within the first 64k of flash");
- and compiled it.
According to the generated hexfile, the stackpointer is 0x20008000 and the start-addr of the app is 0x6679 (Line 401 of the hexfile::"406400000080002079660000ED700000ED700000E...."
.....after the "burning" of the flash is done, I start the blinky-led app as follows:
void LaunchApp(uint32 appAddr)
uint32 *stack = appAddr;
uint32 *app_start = appAddr + 4;
CY_SET_REG32(CYDEV_NVIC_VECT_OFFSET, (appAddr & 0x1FFFFF80));
app_entry = (void (*)(void))(*app_start);
--> "put break point here"
Debugging the bootloader at the break point, it reads the right values!
The starting of the program is "0x6679", which is odd, and therefore the PSOC expects Thumb2 instruction, which is accurate. Stackpointer is 0x20008000, which is ok!
I'm playing around for 3 days, trying and reading "everything" of the startup process on PSOC 5, but it seems to be easier, to accomplish such a task on a LPC1768 ;(.
Probably some of you, know the answer, or has a hint :)