-
Notifications
You must be signed in to change notification settings - Fork 3k
STM32L4: HardFault in Idle Thread Possibly Caused by #7813 #8343
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
Comments
Sometimes it just locks up. I.e. no hard fault but I think it's spinning in a loop. If I prevent attempting to select low-power sleep mode by changing This doesn't make much sense to me as I don't understand why low-power mode, It's not because I'm using the LPTICKER in RTC mode, I tried changing to LPTIM and continued to get problems. |
I missed some important pieces of information... Since 27th Sept we've been using #37654e5 without any problems. We're building with ARM GCC 7.3.1. |
@mattbrown015 out of curiosity - aren't you using CPU HEAP statistics as well ? |
Hi @LMESTM, I'm not sure exactly what you mean because the range, type and implementation of the various statistics has changed since we first started. In other words, I think I enabled the stats that were available when we started circa 5.9.1.
if that answers your question. |
So I'm not sure at all, but you may try out the fix from #8013 , at least for your L4 target and see if that helps at all ? |
Hi it should be:
What do you think ? |
@jeromecoutant but then we are hitting again that mentioned code path which caused the issue in our code (spin-loop for exiting LPR mode). I'll try to get access to a device again and try to reproduce the hardfault in our application. |
I tried running it several times now in our application using the patch in the PR (using mbed 5.8 atm) but I'm not able to reproduce it here. |
I've been doing something else for a couple of days but now I'm back on this! I tried again with the latest master i.e. #6d7b655 which has moved on a bit but the issue is still present. There's definitely something wrong. I had a few goes and the app always hung until I applied this patch (i.e. what @jeromecoutant said):
I'm trying to think what could be different about what I'm doing in comparison to what @MSiglreithmaierRB is doing... I am using tickless but this change is in @MSiglreithmaierRB mentioned mbed-os 5.8, that seems like a long time ago. I'm bang up-to-date and a great deal has changed since mbed-os 5.8, there could easily be a reason why |
So you've tested with #8013 as you're on top of master, right? |
I've updated our trunk from to SD - Add required header file and namespace element instead add all #8006 which is the PR before STM32L4: Fix sleep implementation #7813. I've done a clean build, installed it on 3 of our devices, it's been running for a couple of hours now and I've done numerous resets. As far as I'm concerned, everything is OK with #8006 (#6f338f8).
I tried the latest master earlier which would have included #8013. Our custom target inherits from Just now I did a slightly different test. I applied #8013 to #8006. The .data and .bss sections did move a bit and I ran it to prove this is OK. Then I applied the change from #7813 and immediately got the hard fault.
I've tried
I thought it was interesting that it was an unaligned access but I'm not sure what I was expecting. I didn't get on very well with The build output doesn't seem to include a I tried building with the debug profile but ran out of flash! I wonder if |
Ok so this clearly needs to be fixed. Thanks. Let's move on with @jeromecoutant proposal
@0xc0170 any idea ? |
As of recent build tools, it comes out as "xxx.map.old", presumably due to a last-build-stage rename to support the memory-change output. |
Description
I tried to update to the latest master this morning and was immediately greeted by a
HardFault
. I haven't had any of these recently so I'm almost sure it is because of an mbed-os change.At present I believe it is STM32L4: Fix sleep implementation #7813 that is causing the problem.
Here's the actual fault report although I'm not sure it helps. The thread is the idle thread.
Of course the hard fault is not completely repeatable, it doesn't always happen, it can happen at different points in the application. Although, I believe if it is going to happen the app doesn't run for long.
I created a branch from #6f338f8 and didn't see the hard fault after a few attempts. I appreciate this is not proof that this version is OK.
I also created a branch from #232543a and I saw the hard fault after a few resets. I agree this change looks good but I'm almost certain something is going wrong!
We're not doing anything with the run mode in our app. I.e. we should only be in the sleep and deepsleep modes selected by mbed-os.
I'm not sure if it is relevant but I'm using the LPTICKER in RTC mode; I might try switching to LPTIM to see if that makes the hard fault go away.
I've tried a few other things like increasing the idle thread stack size but didn't find anything that helped.
Issue request type
[ ] Question
[ ] Enhancement
[X] Bug
The text was updated successfully, but these errors were encountered: