Here is the first line of the hex file
th 0802 is the upper 16 bits of the address, and is correct.
Here is the memory section of the linker file:
/* Specify the memory areas */
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
/*FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1536K*/
FLASH (rx) : ORIGIN = 0x8020000, LENGTH = 896K
which is correct.
When I debugged it read 0x80265DD as wntry point from the ROM which seems reasonable since it’s after 0x8020000. Note I have also run my code after the debugger and it is toggling LEDS that I have changed to see that the code ran.
I added the following lines to the start of my main.c
This still did not help it to run.
The ram area you have written should not affect my code unless my code does not clear that ram at start up but the compiler should 0 any areas that are required to be zero by default.
I can’t post the code in it’s entirety as it contains some proprietary source that is required to remain undisclosed.
From all I can see it is executing from the correct location.
The only other thing I noticed when testing my code on it’s own the 2nd and 3rd can port would fail when the calls where slightly rearranged, which is totally confusing.
In the below code if I separate the calls (uncomment the lines) to init the clocks and pins (CANInit) to do all can ports before calling CANswInit then can port 1 would init ok but 2 and 3 would pass waiting for synchronisation but fail when exiting init mode with inak not cleared. In the code below CANInit initializes the can clocks and gpio pins.
for (Port = CANStrt; Port < CANEnd; Port++)
//for (Port = CANStrt; Port < CANEnd; Port++)
gNodeID[Port] = parameters[Port+Var_NETID0].val;
CANswInit(Port, &g_canard[Port], g_canard_memory_pool[Port], sizeof(g_canard_memory_pool),
(Port == 0) ? (onTransferReceived0) : ((Port == 1) ? (onTransferReceived1) : (onTransferReceived2)), shouldAcceptTransfer, gNodeID[Port],
I can post a copy of code but I will need to remove some sections. I’ll see if that is easy to do.