-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32 - TIMEOUT issue since CMSIS5 merge #4459
Comments
ex : mbedgt: greentea test automation tool ver. 1.2.5 |
OS2 tests are also in TIMEOUT for all L4 devices |
Thanks for the report, I'll test one of the devices . I test today mbed os 5 test, not mbed 2. will check. What is interesting it is all toolchains and some devices. All tests also (rtos, or even baremetal for mbed 2 ) ? |
Yes, also bare metal mbed2 tests are showing the problem. |
@bulislaw @0xc0170 In #4294, there is a change to move all platforms from target specific implementation to CMSIS implementation. But those implementations are not the same. I actually moved back to the previous implementation for my test target and I can start my OS2 basic tests again (tested on cortex-M4, NUCLEO_L476RG) Also all targets did not have the same implementation in the target specific file. Can you explain how CMSIS update is supposed to cope with this difference between target specific implementations to align every target to reference CMSIS one ? The target specific one seems to be in charge of ... to be continued. feedback welcome |
@bulislaw @0xc0170 I'd need your feedback / help |
@LMESTM I am looking at this. One related issue is also : #4486 The nvic copy was moved and have to check if we did not keep it in the mbed 2 code. It might be the cas,e I'll fix it and provide it also and test. I started looking at it yesterday however was having tools issues to setup the test cases to debug the timeouts (were able to reproduce). |
@LMESTM Thanks for the description above. Seems like this is the issue, and there might be more. I am currently reviewing all previous vtor reallocations. To align with all these, we should provide default implementation for vtor reallocation (as it is in mbed 5), and targets that do not support it, should provide own implementation (do not define NVIC_RAM_VECTOR_ADDRESS in case its non cortex-m0). This is up to a target, therefore the startup should invoke this function Plus if needed, overwrite the default NVIC_Set/GetVectors functions use these 2 macros:
Does this clear the air a bit? |
@0xc0170 ok thanks.waiting for the outputs of your review?
So you'll add-up this implementation ? and make it called in case of MBED2 as well ?
This part is not so clear yet. Maybe you'll provide more details about the default implementation and list of targets that do not support this default implementation (and where the hook will be)
Id' prefer to avoid this if possible. Do you think all of the above points will be solved in short term ? Or do you plan to revert the CMSIS5 branch in the meantime ? |
I got a default implementatin that I send soon, that should fix lot of targets. The rest needs to be investigated, I'll provide some details here so we can find a solution. (I was debugging failures since yesterday, just found another issue that I'll address separately) |
Thx |
@0xc0170 -today I tested on master after the list of related PRs were merged. MBED2 tests boot ok on NUCLEO_L476RG as I reported last week, but I still fail to boot on NUCLEO_F334R8. If I roll back before CMSIS5 update, this is ok again ... |
mbed 2 boot for NUCLEO_F334R8 ? |
Not only. I also started automated tests on my analogout branch yesterday |
Quick debug session shows the callstack as: SystemInit -> HAL TickInit -> Nvic SetVector -> hardfault As I noticed VTOR points to the flash area (0x0800 0000 address) thus writing to it results in the hard fault). Is that correct? We are looking at this, and will provide a solution here. The ideal would be not to setup ISR before even other things are setup (sdk init, rtx init, heap/stack set). As I recall TickInit is called in SystemInit because of C++ ctor ? Or is there any other reason? I'll go into git history to refresh my memory. |
cc @c1728p9 |
Yes. HAL_TickInit needs to be called before C++ ctors |
I did some digging and found that HAL_Init is called twice, both before C++ global constructors are called. HAL_Init is called in both SystemInit and in sdk_init. The call to HAL_Init in SystemInit is what causes many devices to crash. Can this be removed? |
Looking at version of the F1 cube library 1.4.0 (V4.1.0 in the source code) there isn't a call to HAL_Init in SystemInit. It looks like the one in mbed is F1 cube V1.5.0 (V4.2.0 in the souce code). Do you know where I can find this version? The latest I can download is 1.4.0. Was the addition of HAL_Init to SystemInit done in version 1.5.0, or are these mbed-os specific changes? |
Created PR #4543 for this. Let me know if you have any feedback on it |
Hi
Yes, you are right. V1.5.0 is official but not public yet... We have introduced it in advance in MBED as we needed Low Layers drivers which are introduced in this version for this F1 family.
MBED specific change. |
Hi
|
Thanks @jeromecoutant , I'll retest uARM. Any specific target you tested so I can reproduce quickly? Doesn't work ? Not reaching main or what is the error? |
@jeromecoutant I can't reproduce. uARM for Nucleo L476RG - MBED_A21 - works for me. latest master. Please provide more details, otherwise we can't reproduce anything neither to fix |
ex with the nucleo you have: | OK | NUCLEO_L476RG | uARM | DTCT_1 | Simple detect test | 0.53 | 10 | 1/1 | |
Hi any updates about uARM issue ? |
I'll have a look soon to reproduce the above timeouts. |
I believe I found it, @jeromecoutant , this was once discovered : https://github.com/ARMmbed/mbed-os/pull/2160/files (you can read about microlib not having post stack/heap hook) so was in retarged open called. This would explain what I am seeing, nvic is not copied neither mbed sdk init called. I'll send a patch shortly for review |
Done, look at #4671 please |
Non regression tests with last label are back to a good level |
Description
Since #4294 merge, we got many issues with STM32 targets.
Tests are still on going, but it seems that:
Toolchain version:
All
mbed-cli version:
1.1.1
The text was updated successfully, but these errors were encountered: