Skip to content

Forcing serial to be enabled in retarget.cpp prevents the NRF51 from entering low power mode. #140

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

Closed
marcuschangarm opened this issue Jan 15, 2016 · 5 comments · Fixed by #145

Comments

@marcuschangarm
Copy link
Contributor

The sleep current jumps from ~1uA to ~4 mA.

#139

@ciarmcom
Copy link
Member

ARM Internal Ref: IOTSFW-1821

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 18, 2016

Please provide more details of the testing app, your target , toolchain.

I assume your app does not use any Serial object, neither stdio. Previously with gcc toolchain, the serial stdio object would not be initialized until open for stdin/out/error was invoked. This was not case for ARMCC. Did you test ARMCC ? The fix you referenced was a fix for regression casued by the previous pull request for stdio serial, thus we will need to look at both change-sets.

@marcuschangarm
Copy link
Contributor Author

This is a feature on the NRF51. If you touch the serial, you use more power.

My question to you is why on Earth would you initialize the serial port by default for all mbed targets? Once you start building actual products the serial line is most likely not used at all. On some targets, setting the USBTX/RX to NC and calling init_serial results in a hardfault, for who would initialize a peripheral that is not connected?

@bogdanm
Copy link
Contributor

bogdanm commented Jan 18, 2016

If you look at the code:

https://github.com/ARMmbed/mbed-drivers/blob/master/source/retarget.cpp#L109

you'll see that the actual initialization only happens for those targets that have DEVICE_SERIAL enabled.

@marcuschangarm
Copy link
Contributor Author

Setting DEVICE_SERIAL to 0 breaks on the NRF51 and EFM32. It works on the K64F.

I thought the DEVICE_SERIAL meant whether or not the peripheral was present on the platform, not if you want to use it in you application or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants