Problems with custom board at FLASH->ACR access
Hi all,
we are working on our second custom boardfor our product, using STM32F446RET6 MCU, 8MHz HSE and 746Hz LSE external crystals. From the first board to this one the only difference it's that all needed chips are integrated in one PCB, instead of having 3 PCBs connected with wires in the first version.
Debugging the first board is fast and works. On the second one it takes 20-30 seconds to stop in the main breakpoint or just fails silently. When it runs, it triggers a hard fault on this instruction (line 2):
// stm32f4xx_hal_rcc.c:HAL_RCC_ClockConfig�?�?
if(FLatency < (FLASH->ACR & FLASH_ACR_LATENCY)) // HARD FAULT HERE!!!
{
/* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */
__HAL_FLASH_SET_LATENCY(FLatency);
/* Check that the new number of wait states is taken into account to access the Flash
memory by reading the FLASH_ACR register */
if((FLASH->ACR & FLASH_ACR_LATENCY) != FLatency)
{
return HAL_ERROR;
}
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
Looking at the
https://paste.ofcode.org/336un8t6JR3cwVmvsdeKUux
I see aUNDEFINSTR error, with the PC register loaded with the instruction on line 2 (above).
Do you have any idea on what can be happening?
EDIT
https://www.diffchecker.com/QVY6Ocfg
of the OpenOCD output when using the newest board (on the left) and the oldest one (on the right). Shouldn't the line 51 (below) be the same for the same .elf file? If it should, what can be causing this?xPSR: 0x01000000 pc:
0x1fff503a
msp:
0x20002af8
-Power source stays constant at 3.4V - if the FPU or clock speed werethe problem shouldn't it be happening in both boards? Both crystals work at the expected frequency.