HW or SW issue?
Hallo,
I needed more performance for my project, so I replaced my STM32F401 Blackpill by a WeAct STM32H723VGT6 board. I adapted my HW to accomodate the different layout of the H723 board and modified my application where needed because differences in various registers. When done I built my project with STM32CUBEIDE version 1.15.1 , upload it and tried to run it in Debug mode. I apply a simple 4wire ST-Link for the upload and debug communication.
Unfortunately, already in the second configuration statement I encounter an error, stating that a specific memory address cannot be read. I will try to give as much info as I can, hoping that more experienced members are able to conclude if this is a HW issue (just a bad part in the memory) or a SW error (just a case of bad code).
With trial and error I determined the exact statement that produces the error. The picture below shows the 'Debug' window and the window with the 'Disassembly' control.
The content of the 'Disassembly output' is shown here:
0800542a: and.w r3, r3, #2
0800542e: cmp r3, #0
08005430: beq.n 0x8005454 <HAL_RCC_ClockConfig+560>
08005432: ldr r3, [r7, #4]
1132 if (FLatency < __HAL_FLASH_GET_LATENCY())
08005434: ldr r2, [r3, #12]
08005436: ldr r3, [pc, #80] @ (0x8005488 <HAL_RCC_ClockConfig+612>)
08005438: ldr r3, [r3, #24]
0800543a: and.w r3, r3, #15
0800543e: cmp r2, r3
08005440: movs r3, #1
1135 __HAL_FLASH_SET_LATENCY(FLatency);
08005442: b.n 0x8005552 <HAL_RCC_ClockConfig+814>
08005444: movs r0, #0
08005446: strh r0, [r0, r0]
08005448: add r0, r0
0800544a: ldr r2, [r0, r0]
0800544c: ldr r3, [r7, #4]
0800544e: ldr r3, [r3, #0]
08005450: and.w r3, r3, #4
1139 if (__HAL_FLASH_GET_LATENCY() != FLatency)
08005452: lsls r4, r0, #12
08005454: cmp r3, #0
08005456: Failed to execute MI command:
-data-disassemble -s 134239318 -e 134239502 -- 3
Error message from debugger back end:
Cannot access memory at address 0x800545a
08005457: Failed to execute MI command:
-data-disassemble -s 134239319 -e 134239503 -- 3
Error message from debugger back end:
Cannot access memory at address 0x800545a
08005458: Failed to execute MI command:
-data-disassemble -s 134239320 -e 134239504 -- 3
Error message from debugger back end:
Cannot access memory at address 0x800545a
08005459: Failed to execute MI command:
-data-disassemble -s 134239321 -e 134239505 -- 3
Error message from debugger back end:
Cannot access memory at address 0x800545a
0800545a: Failed to execute MI command:
-data-disassemble -s 134239322 -e 134239506 -- 3
Error message from debugger back end:
Cannot access memory at address 0x800545a
0800545b: ldr r2, [r3, #16]
0800545d: ldr r3, [pc, #252] @ (0x800555c <HAL_RCC_ClockConfig+824>)
0800545f: ldr r3, [r3, #24]
1141 return HAL_ERROR;
08005460: bcs.n 0x800548c <HAL_RCC_ClockConfig+616>
08005462: ldr r3, [pc, #32] @ (0x8005484 <HAL_RCC_ClockConfig+608>)
08005464: ldr r3, [r3, #0]
08005466: bic.w r2, r3, #15
0800546a: ldr r1, [pc, #24] @ (0x8005484 <HAL_RCC_ClockConfig+608>)
1146 if (((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_D1PCLK1) == RCC_CLOCKTYPE_D1PCLK1)
0800546c: ldr r3, [r7, #0]
0800546e: orrs r3, r2The problem is caused by the statement '__HAL_FLASH_SET_LATENCY(FLatency);' which matches the statement I stepped into in my debug stepping. It struck me the error occurs just at a point where the latency of Flash access is checked after adjustment. Is just just a coincidence or an understandable reason for this error?
This problem is repeatable, which gives me the impression I face a HW error in the Flash memory. However, I'm not experiencend in MCU programming, so maybe I'm wrong. Can anyone shed some light??
Thanks in advance,
Fred Schimmel