Some toolchains, like Sourcery CodeBench Lite 2013.05-23 arm-none-eabi
(http://sourcery.mentor.com/public/gnu_toolchain/arm-none-eabi/)
automatically force the alignment of an output section LMA to use the
maximum alignment of all its input sections. This toolchain uses GNU
binutils 2.23, and this automatic behavior is the same as the manual
behavior of the ALIGN_WITH_INPUT feature of GNU binutils 2.24+.
This behavior is not an issue per se, but it creates a gap between
_etext and the LMA of the .data output section if _etext does not have
the same alignment, while reset_handler() initialized this section by
copying the data from _etext to its VMA, hence an offset in the
addresses of loaded data, and missing data.
This commit fixes this issue by making reset_handler() directly use the
LMA of the .data section using LOADADDR(.data), rather than assuming
that _etext is this LMA.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
When using this code:
(int8_t)tmp102_read_temp_x100() / 100
Only the first value is casted into a int8_t type.
tmp102_read_temp_x100() returns the temperature in Celcius * 100. Most of
the time this value will be lower than -2^7 and higher than 2^7 (+/- 1.27°C).
The cast is not needed but a comment about this implicit cast has been added.
Document the URL of the older Sourcery G++ Lite 2008q3-66 arm-none-eabi
toolchain mentioned by README.md so that users can easily find it if
needed.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
This changes the CC26xx simple demo so that a devices running this firmware will achieve the lowest possible energy consumption without requiring any changes to the example
* Only enable TX by default.
* Add some magic for RX handling. When an input handler is registered:
* Automatically enable RX-related and interrupts
* Automatically lock the SERIAL PD on under all power modes
* Automatically enable the UART clock under sleep and deep sleep
* Automatically undo all of the above when the input handler becomes NULL
* As a result, modules / examples that need UART RX no longer need to clock the UART and manipulate the SERIAL PD. They simply have to specify an input handler
* Don't automatically power on the UART whenever the CM3 is active
* Before accessing the UART, make sure it is powered and clocked
* Avoid falling edge glitches
* Fix garbage characters / Explicitly wait for UART TX to complete
* Implement new style of PD locks
* Use our own shutdown sequence rather than the one provided by cc26xxware
* Shutdown from within the interrupt that requested it. This allows shutdown to take place even if the code is stuck in a loop somewhere else
* Improve DCDC/GLDO/uLDO switching logic
* Explicitly handle oscillators and retentions
* Keep MPU_PWR low when the sensor is not in use
* Deselect the sensor when not in use, in order to restore the I2C ping state
* Explicitly control the MPU_INT pin
* Don't shutdown the sensor when it's shut down
* Remove explicit shutdown-related API extension. It is no longer required