-
Notifications
You must be signed in to change notification settings - Fork 3k
LPC1768, hard fault when calling fopen() after Ethernet connect #6578
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
@kjbracey-arm @mikaleppanen Please review |
I'm reckoning the exception is happening as
Somehow starting the Ethernet has stopped the semihosting from working - deactivated the debug connection or made it lose sync? Now, I know nothing much about the semihosting implementation - I suggest referring this to someone who knows how that's supposed to work, and what could interfere with it. Maybe someone who can reproduce it could try a [Mirrored to Jira] |
Looks like it's nothing to do with the Ethernet - same basic effect can be triggered much more simply as shown in #6624. |
cc @mmahadevan108 |
Is this actually resolved? I'm seeing this exact issue when sending code to an FPGA across the SPI. I'm migrating code from OS 2 to 5.13 and I'm seeing hard faults whenever I inject a For example:
|
I've not heard of any progress. Since this issue was filed, I've become a bit more familiar with the Looking at the LPC1768 sleep implementation, we see this: mbed-os/targets/TARGET_NXP/TARGET_LPC176X/sleep.c Lines 27 to 32 in b82cfcc
That's what causes the issue - the moment the device sleeps (because of the The behaviour is explicitly documented: mbed-os/targets/TARGET_NXP/TARGET_LPC176X/sleep.c Lines 21 to 24 in b82cfcc
Comments elsewhere in that file suggest that the LPC1768 actually has issues with losing debug in deep sleep (as do most devices), so I wonder whether the disconnect is really necessary for a normal sleep. The usual setup in other devices is that A debug profile build globally stops the sleep manager from ever using Maybe It would be good if someone at @ARMmbed/team-nxp could look at this. In the meantime, maybe you could just experiment and take out that disconnect call? Have a look at LPC1768 documentation for hints about the way the sleeps should be working? |
Hey Kevin, Thanks for the feedback and heads up. Interesting - I noticed that there's no 'profile' setting in the online compiler (that I could see) for picking release/developer/debug. So that could be the overall issue in my case; online compiled versions of the codebase did not hardfault, whereas mbed studio compiled versions did. I may just see about doing a developer/release build and see if the issue persists. I'm hesitant on removing the Again, thanks. |
@janjongboom thank you for raising this issue.Please take a look at the following comments: Could you add some more detail to the description? A good description should be at least 25 words. NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'.This indicates to us that at least all the fields have been considered. |
We've updated our automation, I will fix the requirements . |
Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. |
We closed this issue because it has been inactive for quite some time and we believe it to be low priority. If you think that the priority should be higher, then please reopen with your justification for increasing the priority. |
We face the exact same issue. Accessing mbed (5.15.5) LocalFileSystem after SPI bus communication took place, results in a crash / hardfault. Any update on this issue? We need to be able to write some settings to the flash rom after SPI is initialised. |
I haven't seen any update related to the problem. @ARMmbed/team-nxp would you be able to help? @defcon8 the reply from Kevin above provides good details related to sleep and wait_ms. Or just use storage instead of localfilesystem? |
Uh oh!
There was an error while loading. Please reload this page.
Description of defect
I am seeing a hard fault when calling fopen() after Ethernet connect.
Expected behavior
Calling
fopen()
after callingconnect
on the ethernet interface does not throw an error.Actual behavior
It hard faults.
Target(s) affected by this defect ?
LPC1768
Toolchain(s) (name and version) displaying this defect ?
ARM
What version of Mbed-os are you using (tag or sha) ?
mbed-os-5.4.0
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
n/a
How is this defect reproduced ?
Example program is here https://os.mbed.com/questions/80658/HardFault-occurs-when-fopen-is-called-af/
User verified working behavior on Mbed 2 and Mbed OS 5.3; broken behavior on 5.4 and 5.8.
The text was updated successfully, but these errors were encountered: