Commit Graph

10323 Commits

Author SHA1 Message Date
Benoît Thébaudeau
1cd3c9e7e5 cc2538: Initialize .data/.bss using ROM functions
This is safer because the previous code assumed that the start and end
VMAs of .data and .bss were word-aligned, which is not always the case,
so the initialization code could write data outside these sections. The
ROM functions support any address boundary.

This is faster because the ROM functions are ultra optimized, using
realignment and the LDM/STM instructions, which is much better than the
previous simple loops of single word accesses.

This is smaller because the ROM functions don't require to add any code
to the target device other than simple function calls.

This makes the code simpler and more maintainable because standard
functions are not reimplemented and no assembly is used.

Note that this is also faster and smaller than the corresponding
functions from the standard string library.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2015-05-23 18:50:52 +02:00
Benoît Thébaudeau
609c615303 cc2538: Move the stack out of .bss
The initialization code clearing .bss is allowed to use the stack, so
the stack can not be in .bss, or this code will badly fail if it uses
the stack.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2015-05-23 18:50:52 +02:00
Benoît Thébaudeau
0de729572b cc2538: Word-align .data LMA
In order to be fast, the reset_handler() function uses word accesses to
initialize the .data output section. However, most toolchains do not
automatically force the alignment of an output section LMA to use the
maximum alignment of all its input sections. Because of that, assuming
that .data contains some words, the LMA of the .data output section was
not word-aligned in some cases, resulting in an initialization performed
using slow unaligned word accesses.

This commit forces the alignment of the LMA of the .data output section
with a word boundary in order to always use fast aligned word accesses
to read the .data load area.

Note that this solution is better than using ALIGN_WITH_INPUT, both
because the latter is a new feature incompatible with older toolchains,
and because it could create a big gap between _etext and the LMA of
.data if strongly-aligned data were added to .data, although only a word
alignment is required here.

The same considerations apply to the VMA of .data. However, it is
already automatically word-aligned, both because .data contains words,
and because the end VMA of the previous output section (.socdata) is
word-aligned. Moreover, if the VMA of .data were forcibly word-aligned,
then a filled gap could appear at the beginning of this section if
strongly-aligned data were added to it, thus wasting flash memory.
Consequently, it's better not to change anything for the VMA of .data,
all the more it's very unlikely that it does not contain any word and
that the end VMA of .socdata becomes non-word-aligned, and this would
only result in a slower initialization.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2015-05-23 18:12:54 +02:00
Benoît Thébaudeau
0d260f61a0 cc2538: Fix .data LMA/VMA mismatch with some toolchains
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>
2015-05-23 18:12:53 +02:00
Antonio Lignan
630b7f8963 Merge pull request #1084 from ludov04/master
Z1: tmp102: simple: fixed wrong cast
2015-05-22 21:59:31 +02:00
Matthieu Baerts
78b6b50194 Z1: tmp102: simple: fixed wrong cast
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.
2015-05-22 18:15:26 +02:00
Laurent Deru
9782a760b1 rpl_process_dio: Update parent rank 2015-05-22 17:21:53 +02:00
Laurent Deru
ccd3c58280 rpl_select_parent: Update dag rank according to new parent 2015-05-22 17:21:53 +02:00
Laurent Deru
fc8415e1ad Allow rpl default route lifetime to be infinite 2015-05-22 13:00:06 +02:00
Antonio Lignan
2cee62eb33 Merge pull request #1074 from g-oikonomou/cc26xx/contrib/new-cc26xxware
Update to latest CC26xxware and add it as a submodule
2015-05-21 10:01:00 +02:00
Nicolas Tsiftes
36d5c5dd27 Merge pull request #1077 from rajithr/patch-1
Remove redundant assignment
2015-05-20 19:45:25 +02:00
rajithr
0d8de9022c Remove redundant assignment 2015-05-20 15:37:32 +05:30
Benoît Thébaudeau
a6c5a49a88 Merge pull request #1065 from uknoblic/cc2538_speed
CC2538: Allow for configuration of processor clocks
2015-05-19 22:48:25 +02:00
Ulf Knoblich
d8efa8428c cc2538: Allow for configuration of processor speed 2015-05-19 18:55:55 +02:00
Fredrik Österlind
d1f976886f Merge pull request #1040 from atiselsts/cooja_multichannel
Improve multichannel support in Cooja
2015-05-19 08:59:06 +02:00
Adam Dunkels
730bda2001 Merge pull request #883 from cmorty/pull/global-macros
Move MAX, MIN and ABS to contiki-macros
2015-05-18 21:33:00 +02:00
Benoît Thébaudeau
b8ff3251e1 Merge pull request #1042 from uknoblic/cc2538_spi
CC2538: added support for SSI1
2015-05-18 20:36:45 +02:00
Simon Duquennoy
2157077f43 Merge pull request #1054 from cmorty/pull/regression_tools
Add regression-test for tools
2015-05-18 10:29:30 +02:00
Ulf Knoblich
a388a1bcd7 CC2538: added support for SSI1 2015-05-18 10:02:55 +02:00
Moritz 'Morty' Strübe
038ee9f82b Add to regrssion: compile-tool sto .travis.yml 2015-05-18 09:12:53 +02:00
Moritz 'Morty' Strübe
0dab6926b3 Move MAX, MIN and ABS to sys/cc.h 2015-05-18 08:53:17 +02:00
George Oikonomou
b861b8f277 Do not try to build cc26xxware documentation 2015-05-17 15:01:02 +01:00
George Oikonomou
541688235c Update the CC26xx README in terms of CC26xxware 2015-05-17 15:01:02 +01:00
George Oikonomou
f680d5dcc5 Do not fetch CC26xxware manually for travis tests 2015-05-17 15:01:02 +01:00
George Oikonomou
5d20e76346 Adjust the build system to use CC26xxware as a sub-module 2015-05-17 15:01:01 +01:00
George Oikonomou
40e82395c4 Pull CC26xxware as a submodule 2015-05-17 15:01:01 +01:00
George Oikonomou
b4067560ba Remove references to obsolete peripheral clock scaling functions 2015-05-17 15:01:01 +01:00
George Oikonomou
ab4249a709 Adjust retention calls
* Rename VIMS-related calls
* Remove obsolete ones
2015-05-17 15:01:01 +01:00
George Oikonomou
b38d32b281 Rename AON WUC power status macros 2015-05-17 15:01:01 +01:00
George Oikonomou
8b1f2ef33c Reset I2C with HAPI call instead of register access 2015-05-17 15:01:00 +01:00
George Oikonomou
8673bbdd55 Update linker script to accommodate for larger CCFG size 2015-05-17 15:01:00 +01:00
George Oikonomou
7a5b670f76 Remove references to IOC_JTAG_DISABLE 2015-05-17 14:09:52 +01:00
George Oikonomou
09a8c54eb1 Update CC26xxware glue macros
* Remove references to removed functions
* Add macros to new functions
* Rename macros to renamed functions
* Add macros for the HAPI
2015-05-17 14:09:52 +01:00
George Oikonomou
5f4154a0e3 Adjust AON BatMon usage 2015-05-17 14:09:51 +01:00
George Oikonomou
32840db66b Update driverlib version macros 2015-05-17 14:09:51 +01:00
Moritz 'Morty' Strübe
c4f8f0acfb Add regression-test for tools 2015-05-17 12:26:08 +02:00
Antonio Lignan
60a301ef9f Merge pull request #1072 from bthebaudeau/cc2538-add-arm-2008q3-66-arm-none-eabi-url
cc2538dk: README: Add URL of Sourcery G++ Lite 2008q3-66
2015-05-17 10:04:36 +02:00
Benoît Thébaudeau
e88b3908ad cc2538dk: README: Add URL of Sourcery G++ Lite 2008q3-66
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>
2015-05-17 01:53:09 +02:00
Benoît Thébaudeau
25532e8abf Merge pull request #754 from wwhuang/master
[CC2538] Fix SPI_FLUSH
2015-05-16 20:55:30 +02:00
Antonio Lignan
e8b1a57ac6 Merge pull request #809 from cmorty/pull/msp430_gstabs
[MSP430] Add gstabs debug information (dwarf is broken)
2015-05-16 11:01:47 +02:00
Antonio Lignan
32afadea77 Merge pull request #1047 from g-oikonomou/cc26xx/contrib/lpm
CC26xx Ultra Low Power Operation
2015-05-16 10:27:22 +02:00
George Oikonomou
1cf37e0c1a Tidy-up code style 2015-05-15 23:36:54 +01:00
Simon Duquennoy
f45c6ad1b0 Merge pull request #1048 from cmorty/pull/serialdump
Fix and clean up serialdump.c
2015-05-15 20:12:58 +02:00
Antonio Lignan
402eabecca Merge pull request #929 from lab11/delete-old-coap
Delete old CoAP implementation
2015-05-15 15:49:04 +02:00
George Oikonomou
7ae3cd49ba Make sure SSI0 is powered and clocked before accessing it
* Fail all SSI0 operations if the module is not powered and clocked
* Make sure SERIAL is powered before trying to enable run mode clock
2015-05-15 11:38:20 +01:00
George Oikonomou
78d04f812b Fix typo in macro 2015-05-15 09:21:05 +01:00
George Oikonomou
7e00eeb76a Achieve lowest consumption with the CC26xx demo:
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
2015-05-15 09:21:05 +01:00
George Oikonomou
019143226b Adjust main:
* Re-order OSC, VIMS cache, I/O latch configuration instructions
* Don't automatically enable UART RX: Let the example decide this
2015-05-15 09:21:04 +01:00
George Oikonomou
07272b7cd6 Improve UART power-cycling logic:
* 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
2015-05-15 09:21:04 +01:00
George Oikonomou
34f52ed08e Improve the LPM module:
* 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
2015-05-15 09:21:04 +01:00