Here is the first line of the hex file
:020000040802F0
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 */
MEMORY
{
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
LL_AHB1_GRP1_ForceReset (LL_AHB1_GRP1_PERIPH_ALL);
LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_ALL);
LL_AHB2_GRP1_ForceReset (LL_AHB2_GRP1_PERIPH_ALL);
LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_ALL);
LL_AHB3_GRP1_ForceReset (LL_AHB3_GRP1_PERIPH_ALL);
LL_AHB3_GRP1_ReleaseReset(LL_AHB3_GRP1_PERIPH_ALL);
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++)
{
CANInit((CAN_Init_t*) &CAN_Init[Port]);
//}
//for (Port = CANStrt; Port < CANEnd; Port++)
//{
//gpioSet(LED2_GPIO_PORT, LED2_PIN,1);
gNodeID[Port] = parameters[Port+Var_NETID0].val;
CANswInit(Port, &g_canard[Port], g_canard_memory_pool[Port], sizeof(g_canard_memory_pool[0]),
(Port == 0) ? (onTransferReceived0) : ((Port == 1) ? (onTransferReceived1) : (onTransferReceived2)), shouldAcceptTransfer, gNodeID[Port],
filter_configs,ARRAY_SIZE(filter_configs));
//gpioSet(LED3_GPIO_PORT, LED3_PIN,1);
}
I can post a copy of code but I will need to remove some sections. I’ll see if that is easy to do.
Thanks.