2026-03-04 1:00 AM
Controller: STM32F303ZE
Written a function to read ROM memory as below
void ServiceROMRead(tst_ServiceDataset* ptrService)
{
// Variable holds ROM address
DWORD ROMAdd = DIAG_ZERO;
// Flag represents JUP service trigger state.
RFJupExeFlag = TRUE;
// Address from where the data needs to be read
ROMAdd = ptrService->DataAddr;
//Check for the EEPROM address
if((ROMAdd > ROM_ENDADD)) //ROM_ENDADD is 0x0807AFFF
{
// wrong address
ptrService->State = WRONG_DATA;//Indicator for wrong address passed
}
else
{
ptrService->ptrData = (BYTE *) ptrService->DataAddr;
}
}
When I pass ptrService->DataAddr as 0x8000020 or 0x8000080 to the above function ServiceROMRead from my application it is sometimes leads to a system reset
Application is placed at 0x08003000 to 0x0807AFFF
Bootloader is placed at 0x08000000 to 0x08002FFF
1. Why is the controller resetting when I try to read ROM from address 0x8000020 or 0x8000080?
2. Will trying to read data from address 0x8000020 or 0x8000080 if any Interrupt occurs will this lead to system reset
3. Is there any specification that tells which address of the ROM or application we are not supposed to read when the application is running
2026-03-04 2:58 AM
There's no reason for accessing any part of memory map to lead directly to system reset.
One scenario would be, that fault in accessing some address results in memory fault escalated to hardfault, and that you have no hardfault handler and default handler goes to an infinite loop. If you have watchdog activated, this would lead to system reset.
If this is the case, either write a fault handler which outputs some information, or simply place a breakpoint at the fault handler and investigate the fault as usually in the debugger.
JW