ReadDHCSR Fail with STM32F4 update

mikroC, mikroBasic and mikroPascal for PRO ARM® MCUs, supporting STM32, Tiva, Kinetis, & CEC devices
Post Reply
Author
Message
dhinson919
Posts: 2
Joined: 26 May 2023 14:45

ReadDHCSR Fail with STM32F4 update

#1 Post by dhinson919 » 27 May 2023 20:24

Earlier I posted a problem I was seeing on a Fusion for STM32 v8 board with STMF407ZG when CODEGRIP debugging the LedBlinking sample, but I don't see that post so I must've done something wrong. I have an update anyway.

The problem appears to be within the GPIO_Config() function for F4s which in this case is attempting to set all pins of port A (GPIOA_MODER) to general purpose output mode (0x55555555). That then appears to be breaking the debugger. Specifically overriding the MODER13 and MODER14 bits from their reset values seems to be problematic:
ReadDHCSRFail2.png
ReadDHCSRFail2.png (239.69 KiB) Viewed 350 times
When I use the debugger to break at the offending instruction and change R3 to set all pins except for MODER13/14 (0x69555555) then the code proceeds normally:
ReadDHCSRFail3.png
ReadDHCSRFail3.png (225.07 KiB) Viewed 350 times
Since Lib_GPIO_32F4xx.c doesn't seem to be part of the mickroC Pro kit it's hard to tell what condition is causing the offending code to be called. Maybe a change to some debugger setting can allow it to be avoided? In the meantime it's not clear how this sample could have worked for the F407ZG which is curious since the comment at the top of the LedBlinking.c specifically mentions the device.

Post Reply

Return to “ARM PRO Compilers”