Hello there smart people,
we are currently developing our bootloader for the S32K324 and use theMemAcc with the underlying Mem_43_INFLS driver from the S32K3_S32M27x Real-Time Drivers ASR R21-11 Version 4.0.0 P19 driver package.
There I noticed that the MemAcc_Write() function works flawlessly as long as I write data into the Data-Flash section. As soon as I have a code flash section that I want to write to the drive does write between 16-Byte and 128-Byte of data before resulting in a Hardfault.
I allready checked the HFSR and it states an FORCED Hardfault and the BFSR does show an IMPRECISERR.
The memoryaddress I try to write is th 0x440000 - 0x442000. a codeflash section wich is aligned to the 8k sector boundary and after flashing still uninitialized. So it contains only 0xFF.
I try to switch to the C40 Driver for a testrun and there the Flash didn't accept any data while the driver returned STATUS_SUCCESS. But here a hardfault didn't happen.
Does anybody has an Idea how I can further debug my problem?
已解决! 转到解答。
Hi @FelixR,
If you have the MEM_43 code in the same block as the one you program, there will be RWW issues.
The code should be placed in either another flash block or SRAM.
Refer to the User Manual MEM_43 driver.
BR, Daniel
Hi @FelixR,
If you have the MEM_43 code in the same block as the one you program, there will be RWW issues.
The code should be placed in either another flash block or SRAM.
Refer to the User Manual MEM_43 driver.
BR, Daniel
Hey @danielmartynek,
I thought so too that there might be a RWW error when targeting errors inside the same Code-Flash block. But that is not the case.
I tested writing Data into the C-Flash Block 3 while the Code was executed inside the C-Flash Block 0. There also the HardFault happened.
Also I tested the Settings you highlighted inside your picture. This also didn't help and the HardFault was still present.
I checked the Stack-Trace before the HardFault was called and noticed, that the CAN Error-Interrupt somehow takes part in this.
Now, removing the CAN-Error Interrupts did solve my problem. Now the C-Flash can be written. But how is this related? This Code executed inside this error Interrupt is also not inside the C-Flash Block 3 I'm trying to write?