-
Notifications
You must be signed in to change notification settings - Fork 104
stm32u5 example hanging #256
Comments
Hi, thanks for posting, and sorry you're having trouble with this. It is really weird: obviously this is a relatively fundamental thing. If We tested the preview branch with the same version of x-cube-freertos as you, v1.1.0, so it seems unlikely to be a version thing. I can't see anything wrong with your build command-line or your file changes but a first step, if you haven't tried this already, might be to run without the file changes and see if execution gets past this point; the fact that the pins etc. don't line up with reality shouldn't matter up to here, at least. I'd guess this will turn out the same way but it is worth eliminating as a possibility. Just for reference, find attached the log output from the target when we last ran this ourselves. I'm a bit stuck as to what else to suggest. Maybe something will come to me overnight... |
This isn't going to be helpful at all but I have a very vague memory of having a problem of this nature (i.e. an unexplained failure to run quite early on) when starting the integration of STM32U5 and it was due to the clock/tick not running. I don't believe there are any jumpers of significance on that board but it might be worth, for instance, adding an infinite busy loop or some such just before the |
Hi Rob, Thanks for your replies.
I tried this, but I'm not seeing any difference. I.e. it is still only getting as far as:
I tried this with two different NUCLEO-U575ZI-Q boards, one brand new out of the box, but same behavior on both. Another developer here also repeated it, with his own build environment and hardware, and he is also seeing the same thing happen.
I'm not entirely sure I follow what you're asking me to try here. What I did do is add the following code to run just before the call to
which gives me the expected output (but still gets no further):
While I didn't measure it too accurately, from a quick stopwatch eyeballing the call to
As a sanity check, rather than cloning from github, I also tested using the x-cube-freertos packs downloaded using STM32CubeMX. Using version 1.1.0 and 1.2.0 from here shows the same results. So, ruling out x-cube-freertos (for now), another variable in the mix is the toolchain. I'm currently using the version included with STM32CubeCLT v1.15.1. However, when building I notice the following warning (see full build log attached):
Is this warning expected? The version of newlib included in the STM32CubeCLT v1.15.1 is 4.3.0. Can you tell me what toolchain version you were using to test, and/or where to find it, so that I can try that? Thanks |
As expected I think, but it was worth a try.
That sounds like the clock is ticking then. Just to double-check, I have pulled the preview branch back from here onto a fresh branch locally and pushed it to our test system and that still turns out fine, build and [initial part of] run logs attached. What can be the difference?
This is just a paranoid https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-win32.zip EDIT: find attached a |
It seems the toolchain is the culprit. When I build using the So the next question is why is the ST Micro toolchain causing problems? The ST Micro toolchain is a patched version of the ARM 12.3.1 release. As a sanity check I grabbed a copy of the official 12.3.1 release from ARM (here), and I'm seeing the same behaviour as when using the ST Micro toolchain (i.e. the application gets as far as We have a strong preference for sticking with the ST Micro toolchain (this is part of a large project, and all of the partners made the decision to standardize on this version of the ST Micro toolchain early on) so do you have any thoughts about what might be going on here and/or what to do about it? Thanks |
Well found! I never would have expected that. We have a ticket open to move to a later GCC version, which would be GCC ARM 12.3.1 I guess. I do have a spare STM32U5 board that I can grab and set up the debugger etc., will do that now and see what gives... |
Update: I've now tried a local build with the latest version of the GCC ARM toolchain from: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads ...which turns out to be
In other words, the code is executing but all trace output is stopped by something or other that occurs in the
...results in this:
No "Alive 4". Will continue to dig. |
So the problem lies here: ubxlib/port/platform/stm32cube/src/u_port_os_pure_cmsis.c Lines 166 to 186 in ab58361
As you can see, this code was added to fix a memory leak on task deletion resulting from an interaction between the way https://forums.freertos.org/t/making-sure-a-deleted-tasks-os-clib-resources-have-been-freed/11132/28 Between compiler versions (I've also tried 11.3.1 now and it shows the same thing) something has changed which means that doing the As a temporary measure, just to get things moving, I suggest you delete the above chunk of code locally, then you can move on to other things. I will update this issue when I've checked for leaks. |
I have now verified that whatever they did in building Since When you have time, please delete your old copy of the preview branch and pull the new version; this has passed our testing with ARM GCC 13.2.1 and hopefully it will work for you. Apologies for all this |
I've tested the latest preview_platform_stm32u5_backup_rmea branch using the ST Micro 12.3.1 toolchain and I can confirm that I am no longer encountering the problem. Thanks for your help!
No need to keep this backup branch around on our account, as I can't see it being needed at any stage. I notice that
Is this anything to be concerned about? If not I think this issue can be closed now. |
Phew, thanks for confirming, I will delete the
I would probably ignore it for now: sometimes when only a subset of tests/examples are being run they don't quite do the same thing as a complete set, e.g. a test might leave resources in place in order to speed up the transition between tests (a full test run is now close to 90 minutes; we'd like it to be more like 30), but if subsequent tests have been filtered out the clean-up will be have been missed. Better to move on with your intended application I think. I will close this issue; please feel free to re-open it, or of course open another issue, if there is more to discuss. |
Hi,
Using the preview_platform_stm32u5_rmea branch I am trying to get an example running with an NUCLEO-U575ZI-Q board connected to a LEXI-R520, using FreeRTOS. The application appears to be getting stuck in
preambleHeapDefence
. See attachedoutput.txt.
I'm new to ubxlib, so I'm probably doing something wrong/silly here.
The only changes I've made after checking out the preview_platform_stm32u5_rmea branch are to u_cfg_app_platform_specific.h (see attached u_cfg_app_platform_specific.diff.txt) to reflect how things are wired up, and to the runner_freertos/Makefile (see attached Makefile.diff.txt)
My build command, from within the
ubxlib/port/platform/stm32cube/mcu/stm32u5/runner_freertos
folder is:make STM32_CMSIS_FREERTOS_PATH=/home/mgh/github/STMicroelectronics/x-cube-freertos UNITY_PATH=/home/mgh/github/ThrowTheSwitch/Unity ARM_GCC_TOOLCHAIN_PATH=/opt/st/stm32cubeclt_1.15.1/GNU-tools-for-STM32/bin
.Digging deeper, I see that within preambleHeapDefence it is getting as far as
uPortDeinit()
(line 133).In turn, within uPortDeinit() it is
uPortEventQueuePrivateDeinit()
(line 269) that is proving problematic.Within uPortEventQueuePrivateDeinit(), the first time through the for loop, i.e.
x == 0
, eventQueueFree() is never returning.Within eventQueueFree(), it's
uPortQueueSend()
(line 175) that is never returning (first attempt to call it).In uPortQueueSend() it is gettting as far as
osMessageQueuePut()
(line 308).I'm using the current main branch of x-cube-freertos (so v1.1.0). In osMessageQueuePut() it is getting to
xQueueSendToBack()
(line 2176).xQueueSendToBack() in turn leads to xQueueGenericSend(). From this point it is getting a bit tricky to keep digging (because
xQueueGenericSend()
seems to be getting called fairly frequently).Any ideas as to what might be going wrong? Do I have a build environment or configuration problem or ...?
The text was updated successfully, but these errors were encountered: