Commit graph

1702 commits

Author SHA1 Message Date
Mohamed seliem 4a93babb58 fix msg.dst.sin6_addr.__u6_addr.__u6_addr16 2016-12-04 03:29:50 +02:00
George Oikonomou 7c54b7cd50 Merge pull request #1867 from MohamedSeliem/patch-6
update uart1.c to include Special function registers bits definitions
2016-11-30 16:37:49 +01:00
Benoît Thébaudeau 8b57670121 cc2538: spi: Add support for dynamic clock frequency
This changes makes it possible to change the SPI clock frequency at
runtime.

Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
2016-11-27 22:50:43 +01:00
Benoît Thébaudeau c76b8235f4 cc2538: spi: Add support for dynamic instances
Previously, only constants could be used to pass SPI instances to the
SPI driver. This change makes it possible to use SPI instances from
variables.

Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
2016-11-27 22:50:43 +01:00
Benoît Thébaudeau 0e5b18635b cc2538: gpio: Add macro to get pin direction
Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
2016-11-27 22:50:42 +01:00
Benoît Thébaudeau 9c47f874c4 CC2538: Enable Cortex-M mtarch implementation
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Benoît Thébaudeau 3f676a5a16 ARM: Add common Cortex-M mtarch implementation
This includes support for preemption ready to be integrated into
exception handlers.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Benoît Thébaudeau ab1491be69 CC2538: Use CMSIS-CORE
Switch to CMSIS-CORE and remove the duplicate code.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Benoît Thébaudeau 9195b49c18 ARM: CMSIS-CORE: Introduce NVIC_IsIRQEnabled()
This function returns the enable state of an interrupt.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Benoît Thébaudeau d3158897c2 ARM: CMSIS-CORE: Fix doxygen warnings
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Benoît Thébaudeau 280dc091d2 ARM: CMSIS-CORE: Bump version to 4.30
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Benoît Thébaudeau ca86d5febf ARM: Fix doxygen style
The rule in Contiki is to use backslashes, not at signs.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Benoît Thébaudeau 4d61e8f997 Merge pull request #1906 from bthebaudeau/fix-cc2538-disabled-lpm-warnings
cc2538: lpm: Fix build warnings with LPM_CONF_ENABLE == 0
2016-10-31 21:38:16 +01:00
Benoît Thébaudeau 6cdba10b1d Merge pull request #1895 from alignan/pull/fix-cc2538-cca
cpu/cc2538: CCA threshold was fixed
2016-10-28 23:42:18 +02:00
Niclas Finne 3982aee329 Added missing include 2016-10-26 00:04:58 +02:00
Benoît Thébaudeau 14ccffd9d4 cc2538: lpm: Fix build warnings with LPM_CONF_ENABLE == 0
Some arguments passed to the functions disabled with
LPM_CONF_ENABLE == 0 could trigger build warnings because they became
unused with this configuration option. Disable these functions by using
empty static inline functions instead of empty macros, so that the
function arguments are always considered by the compiler as used,
without having to #if-out code in many places.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-10-25 22:18:37 +02:00
Antonio Lignan 2f76fc1f77 Merge pull request #1784 from g-oikonomou/contrib/cc1350
Add CC1350 support
2016-10-18 12:04:48 +02:00
Antonio Lignan 2a84e68e6d cpu/cc2538: CCA threshold was fixed 2016-10-18 09:35:04 +02:00
Oliver Schmidt fb4c42a357 Added custom log function for CBM machines.
The log function writes directly to the screen. Combined with the usage of PFS this means that the POSIX layer of the C library isn't referenced anymore thus reducing the memory requirements.
2016-10-15 23:36:53 +02:00
Oliver Schmidt d864e73579 Added directory functions to the Commodore Platform File System.
They reduce the Telnet server's run size by 1231 bytes.
2016-10-15 18:36:54 +02:00
g.oikonomou@bristol.ac.uk ec4b403e77 Allow and document IEEE mode for CC13xx 2016-10-07 10:05:14 +01:00
Mohamed Seliem 682abac7b7 update uart1.c to include Special function registers bits
including "sfr-bits.h" to define PERCFG_U1CFG, and UCSR_MODE
2016-09-21 14:32:09 +02:00
Michael LeMay 24f23588dd x86: Fix section alignment for EFI binaries
This patch fixes the section alignment specification in the linker script for
the Intel Quark X1000 SoC so that the UEFI GenFw program generates correct EFI
binaries.  See the added comment in quarkX1000.ld for details.
2016-09-08 12:13:28 -07:00
Antonio Lignan 6dd17f5eec MSP430/F2xxx: fix ubr msb byte being hardcoded to zero 2016-09-01 10:25:38 +02:00
Antonio Lignan 8cc1870663 Zoul: generic servo driver 2016-08-24 14:27:41 +02:00
Antonio Lignan cb42bafbfb Merge pull request #1756 from g-oikonomou/contrib/cc26xx/new-ccxxwares
Update to latest TI CC13xxware/CC26xxware
2016-08-16 15:44:41 +02:00
Antonio Lignan 7ddbe640be Merge pull request #1795 from g-oikonomou/contrib/sensniff
Add generic sensniff example and remove legacy sniffers
2016-08-16 14:47:17 +02:00
Antonio Lignan 3550d43b47 Merge pull request #1794 from g-oikonomou/bugfix/cc13xx/prop-set-channel
Fix PROP mode channel switching
2016-08-16 12:57:43 +02:00
Benoît Thébaudeau a52a3d94d3 cc2538: uart: Fix garbled output occurring upon lpm_enter()
lpm_enter() must not enter PM1+ if the UART is transmitting. Otherwise,
the UART clock gets disabled, and its TX is broken.

The commit b8b54a033c had already
partially fixed this issue, but it could still occur while transmitting
stop bits because, contrary to UART_FR.BUSY, UART_FR.TXFE takes only the
data bits into account, not the stop bits.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-08-15 03:07:52 +02:00
Antonio Lignan 1cd39a2621 Merge pull request #1780 from g-oikonomou/bugfix/cc2538/sniffer
Don't flush the CC2538 RF RX FIFO unconditionally
2016-08-12 12:09:12 +02:00
George Oikonomou 983a618a36 Extend CC13xx PROP mode driver
We now write a dummy LQI in read() and we also add support for `RADIO_PARAM_RX_MODE` in `set_value()`
2016-08-12 01:23:50 +01:00
George Oikonomou 07f984eec2 Remove legacy sniffer references: Docs 2016-08-12 01:23:50 +01:00
George Oikonomou b0672713bb Remove built-in sniffer support: aducrf101 2016-08-12 01:23:49 +01:00
George Oikonomou a932dfa6df Remove built-in sniffer support: CC2538 2016-08-12 01:23:49 +01:00
George Oikonomou dbd4f630fd Remove built-in sniffer support: CC13xx PROP mode 2016-08-12 01:23:49 +01:00
George Oikonomou 0de1dc1025 Remove built-in sniffer support: CC2530 2016-08-12 01:23:49 +01:00
Benoît Thébaudeau ae5205f9e2 doxygen: Fix orphan modules
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-08-10 04:56:15 +02:00
Michael LeMay bde8eb35ae x86, galileo: Fix UART system call authorization initialization
This patch fixes UART system call authorization initialization (when
protection domain support is enabled) to only initialize the system call
entrypoint and authorization data structures once, prior to per-port
setup. Previously, if two UARTs were configured, the setup procedure for
the second UART would erase the system call authorization for the
first (console) UART, resulting in a crash upon the next attempt to
perform console output.
2016-08-04 16:09:44 -07:00
Michael LeMay 31ad67abd7 x86: Support configurable UART baud rate
This patch extends the Intel Quark X1000 SoC UART initialization API to
accept a numeric baud rate specification.
2016-08-03 07:58:51 -07:00
Simon Duquennoy cda89aaaf2 Merge pull request #1217 from tiagoshibata/c64_compilation_fixes
Fixes compilation targeting c64
2016-07-25 14:57:24 +02:00
George Oikonomou 8ab0522cec Fix PROP mode channel switching
If `NETSTACK_CONF_RADIO.set_value(RADIO_PARAM_CHANNEL, ...)` is called when radio is on, it will fail to apply the channel change, because it won't re-send `CMD_PROP_RADIO_DIV_SETUP` and `CMD_PROP_FS`. This commit fixes this condition, by making sure the correct commands are sent to the radio.
2016-07-24 03:39:13 +01:00
Sumankumar Panchal 3bb58b7c82 Minor data type correction. 2016-07-22 22:49:49 +05:30
George Oikonomou 16f56abfad Wait for a valid RSSI reading in CC13xx/CC26xx RF drivers
As discussed in #1341, the current CC13xx/CC26xx IEEE mode driver sends `CMD_GET_RSSI` once and returns the RSSI reading uncondtionally. This happens within the `get_rssi()` function.

This logic is broken if `get_rssi()` is called with the radio off. The function will make sure to turn on the radio first, but it does not make sure the RSSI reading is valid, which only happens a number of symbol periods after the radio enters RX. The outcome is that `NETSTACK_RADIO.get_value(RADIO_PARAM_RSSI, ...)` will always return -128 (meaning that RSSI is unavailable) if the radio was off at the time of calling the function.

The same condition affects the prop mode driver.

This commit changes the logic of `get_rssi()`:
* For PROP mode, if `CMD_GET_RSSI` returns an invalid RSSI, we send it again. For unknown reasons, `CMD_GET_RSSI` on occasion returns 0, so we ignore that value too.
* For IEEE mode, we use `CMD_IEEE_CCA_REQ` and we inspect the value of `ccaInfo.ccaEnergy` of the return structure. If the value is 0x02 (Invalid), we send the command again.

Fixes #1341
2016-07-17 18:20:22 +01:00
George Oikonomou eec890d60e Update CC26xxware to v2.24.02.17202 2016-07-17 00:26:52 +01:00
George Oikonomou fd82603786 Update CC13xxware to v2.04.02.17240 2016-07-17 00:26:52 +01:00
George Oikonomou dc1f9fe010 Simplify MODESEL value determination 2016-07-17 00:26:52 +01:00
George Oikonomou 4495d14702 Make ROM bootloader configurable through contiki- or project-conf.h 2016-07-17 00:26:52 +01:00
George Oikonomou ccba6bdb20 Update cpu files to reflect API in latest CCxxware versions 2016-07-17 00:26:51 +01:00
George Oikonomou 0e4c02bf3b Update ChipInfo and OSC macros 2016-07-17 00:25:18 +01:00
George Oikonomou f68b77fdfa Remove ROM AUX timer macros
They have been undefined in CCxxwares
2016-07-17 00:25:17 +01:00
George Oikonomou 171fe8d08e Adjust GPIO macros to reflect API in latest CCxxware 2016-07-17 00:25:17 +01:00
George Oikonomou 788cb1e119 Move ROM function macros to separate file 2016-07-17 00:25:17 +01:00
George Oikonomou 568973f6ec Don't flush the CC2538 RF RX FIFO unconditionally
After reading a frame, `read()` checks the status of the RX FIFO:

* If an overflow is detected, the FIFO gets flushed
* If there are more frames in the FIFO, the `cc2538_rf_process` will get polled again in order to read out the next frame.

#1550 changed `read()`, which now performs the above check for non-poll mode, but it then flushes the FIFO unconditionally. Therefore, if there are two or more frames in the FIFO, they will get flushed before the `cc2538_rf_process` has had a chance to read them out. This results in missed frames.

Reproducing this is trivial: Build a CC2538 sniffer and see how it will never show you .15.4 ACK frames. ACK reception completes while `read()` is still streaming the previous captured frame to the host. Upon completion, the FIFO will get flushed and the ACK will get lost.

This pull proposes removing the unconditional flush and reverting to the original logic for non-TSCH operation.

Pinging @thomas-ha here for input regarding poll mode.

This pull sits on top of #1778
2016-07-17 00:24:47 +01:00
Benoît Thébaudeau c05665a16b Merge pull request #1778 from g-oikonomou/contrib/cc2538/rf-driver-code-style
Improve code style of the CC2538 RF driver
2016-07-17 01:22:21 +02:00
George Oikonomou dcad5e7e3f Merge pull request #1727 from g-oikonomou/contrib/cc26xx/trng
Add CC13xx/CC26xx TRNG Support
2016-07-16 23:34:53 +01:00
George Oikonomou 7fdb9849de Remove unnecessary parentheses 2016-07-16 22:35:23 +01:00
Atis Elsts 2fe4b4d5bb CC26xx: enable MCU sleeping while transmitting if and only if not in poll mode 2016-07-16 18:22:20 +01:00
George Oikonomou c359e98bf1 Change mac_timer_init() to static
We also move the function to a different location so we won't have to provide the prototype separately
2016-07-16 17:11:58 +01:00
George Oikonomou 6ef9509dfb Change get_sfd_timestamp() to static
We also move the function to a different location so we won't have to provide the prototype separately
2016-07-16 17:11:57 +01:00
George Oikonomou 833dc89f7c Fix code style 2016-07-16 17:11:57 +01:00
George Oikonomou 0313f9abf1 Merge pull request #1751 from atiselsts/bugfix/cc26xx_etimer_sleep
CC26xx: fix a regression in and refactor LPM code
2016-07-16 14:45:56 +01:00
Antonio Lignan 23a0449a97 Merge pull request #1753 from g-oikonomou/bugfix/cc26xx/missing-include
Add missing include
2016-06-30 22:53:45 +02:00
Atis Elsts b6617f17c5 CC26xx: always request HF crystal oscillator at radio on() 2016-06-29 16:41:33 +03:00
Atis Elsts 9caaf26012 CC26xx: fix a regression in and refactor LPM code 2016-06-29 01:03:06 +03:00
Benoît Thébaudeau 01a533fb75 Merge pull request #1704 from kkrentz/cc2538-aes-fixes
One fix to CC2538 hardware security
2016-06-25 01:30:16 +02:00
Antonio Lignan 6a2d802b9a Merge pull request #1737 from bthebaudeau/cc2538-fix-missing-result-av
cc2538: aes: Fix possibly missing result available status
2016-06-25 00:14:29 +02:00
kkrentz c28b6fb7ba CC2538: Reboot if the crypto engine fails (error handling is too hard) 2016-06-24 01:50:27 -07:00
Benoît Thébaudeau 1da00a482f cc2538: aes: Fix possibly missing result available status
Depending on the use case and on the timings,
aes_auth_crypt_check_status() sometimes never reported an available
result, leading to a deadlock of any protothread waiting for this event,
and to a WDT reset if a protothread was polling it.

This was caused by aes_auth_crypt_start() clearing the result available
interrupt after operations that may rightfully trigger it, leading to a
missed interrupt.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-06-23 22:25:27 +02:00
Benoît Thébaudeau 8a273a248e cc2538: Add configuration for firmware location
Introduce FLASH_CONF_FW_ADDR and FLASH_CONF_FW_SIZE in order to make it
possible to place the firmware anywhere, regardless of Coffee, and
without having to write a custom linker script. Also, handle the default
values properly in order to fix the link breakage reported by
Arthur Fabre <arthur@arthurfabre.com> with COFFEE_CONF_CUSTOM_PORT.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-06-19 23:12:02 +02:00
George Oikonomou de18c16c9f Add CC13xx/CC26xx RNG support to the build 2016-06-15 10:32:03 +01:00
George Oikonomou fd9d878e1d Implement random.h API for the CC13xx/CC26xx 2016-06-15 10:32:03 +01:00
George Oikonomou bb4056903c Add CC13xx/CC26xx TRNG driver 2016-06-15 10:32:03 +01:00
George Oikonomou f8864c67fd Add TRNG CCxxware macros 2016-06-15 10:30:17 +01:00
Atis Elsts e233c3f27f cc26xx: change CCA logic to be standard-compatible; change receiving_packet to return true iff sync (SFD) has been seen 2016-06-14 00:54:33 +03:00
Atis Elsts d85667d535 cc26xx: packet queue changes: allow to read packets after radio has been turned off; make pending_packet() return true when there is a packets being received 2016-06-14 00:54:33 +03:00
Atis Elsts 54e4b5f351 cc26xx: allow IEEE 802.15.4 frames with version 2, required for TSCH 2016-06-14 00:54:33 +03:00
Atis Elsts 80aa30c5da cc26xx: add support for RADIO_PARAM_TX_MODE getting and setting and for LAST_RSSI and LAST_LQI reading 2016-06-14 00:54:33 +03:00
Atis Elsts 25c5f0b744 cc26xx: implement support for CC2650_FAST_RADIO_STARTUP 2016-06-14 00:54:33 +03:00
Atis Elsts 97c1cfc3b4 cc26xx: return the expected value 0 from prepare() in ieee and prop mode radio 2016-06-14 00:54:33 +03:00
Atis Elsts e19fbc996e cc26xx: use CMD_IEEE_MOD_FILT to change address filtering instead of fully restarting the radio 2016-06-14 00:54:33 +03:00
Atis Elsts 3a99639294 cc26xx: implement CC2650_FAST_RADIO_STARTUP option, required for TSCH 2016-06-14 00:54:33 +03:00
Atis Elsts a47fb723e4 cc26xx: enable sync between radio timer and RTC, useful for TSCH 2016-06-14 00:54:33 +03:00
Atis Elsts 95b66657aa cc26xx: add TSCH-related rtimer defines 2016-06-14 00:54:32 +03:00
Atis Elsts ac6f8008fd cc26xx: implement poll mode, hardware timestamps, and other minor changes in the IEEE radio driver 2016-06-14 00:54:32 +03:00
George Oikonomou 678f4344d2 Add missing include 2016-06-13 12:04:47 +01:00
Tiago Koji Castro Shibata c2a0f739f7 Compilation targeting c64
Adds some casts required by cc65 compiler and small fixes
2016-06-12 21:16:01 -03:00
Benoît Thébaudeau b655d92aa4 cc2538: Provide SoC information
Add functions providing the SoC revision, SRAM size, and enabled
hardware features, as well as a function printing SoC information.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-06-11 23:23:38 +02:00
Benoît Thébaudeau b3ea790449 cc2538: sys-ctrl: Provide last reset cause
Add functions providing the last reset cause, one as an integer (ID),
and one as a string.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-06-11 23:23:38 +02:00
Antonio Lignan ee0b02c819 Merge pull request #1684 from g-oikonomou/contrib/cc26xx/aux-ctrl-and-adc
Add CC13xx/CC26xx AUX controller module, ADC support, ALS driver and example
2016-06-07 14:36:28 +02:00
Antonio Lignan b3faefe602 Merge pull request #1433 from mdlemay/x86-mm
X86 memory management
2016-06-05 13:49:49 +02:00
Oliver Schmidt 0151a7c27e Merge pull request #1706 from oliverschmidt/master
Make use of new cl65 option --print-target-path.
2016-06-03 15:13:08 +02:00
Oliver Schmidt ae0c5f0dd0 Make use of new cl65 option --print-target-path.
The new cl65 option --print-target-path allows to get rid of CC65_HOME altogether.
2016-06-03 13:30:25 +02:00
Simon Duquennoy 26bf33c762 Merge pull request #1550 from thomas-ha/tsch-cc2538-port
Port of TSCH for CC2538
2016-06-02 21:33:55 +02:00
Antonio Lignan 6fc4e2535c Merge pull request #1665 from g-oikonomou/contrib/cc26xx-bsl
Consolidate .upload for all CC26xx/CC13xx boards and add login make target
2016-06-01 23:37:29 +02:00
Antonio Lignan 9e1c378919 Merge pull request #1469 from wbober/nrf52dk-pr
Add support for nRF52 DK platform
2016-06-01 23:11:39 +02:00
Antonio Lignan f065971efc Merge pull request #1619 from simonduq/pr/tsch-rtimer16-fix
Fix bug in TSCH for platforms with 16-bit rtimer
2016-06-01 23:03:50 +02:00
Benoît Thébaudeau 09a7566e01 cc2538: coffee: Add default micro-log configuration
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-05-30 23:05:14 +02:00
Benoît Thébaudeau bd961d1cd3 cc2538: Fix possible linker script breakage
The conditional definitions in project-conf.h depending on
CONTIKI_TARGET_<TARGET_NAME> were ignored at link time, which broke the
linker script if it used these definitions, so the flashed applications
could crash or malfunction.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-05-30 23:05:14 +02:00
Atis Elsts 487547d8af Add CC13xx/CC26xx ADC driver 2016-05-29 14:30:07 +01:00
George Oikonomou 43b8bf3d30 Add CCxxware macros for AUX ADC 2016-05-29 14:30:07 +01:00