Commit Graph

1138 Commits

Author SHA1 Message Date
LudovicW
66edb5b263 Fix incorrect IEEE address byte re-ordering 2014-06-06 17:22:33 +01:00
George Oikonomou
2e166a83c7 Merge pull request #691 from hexluthor/rts-cts
CC2538: Add hardware flow control (RTS/CTS) support on UART1.
2014-06-04 09:22:58 +01:00
George Oikonomou
ba9c2d40eb Merge pull request #682 from g-oikonomou/watchdog-cc2538
Confine CC2538 WDT on/off conf inside the driver
2014-06-03 22:05:08 +01:00
Adam Dunkels
64f65b4e45 Merge pull request #617 from nfi/extended-radio-api
Extended radio API with support for setting channel, pan id, addressing modes, etc
2014-06-03 21:32:53 +02:00
Ian Martin
274b3dcd0b CC2538: Add hardware flow control (RTS/CTS) support on UART1. 2014-06-03 12:38:24 -04:00
Rémy Léone
25c8b0835d Closing doxygen groups 2014-05-30 11:01:20 +02:00
George Oikonomou
807ee624e4 Confine CC2538 WDT on/off conf inside the driver
Instead of requiring all calls to `watchdog_start` to be
wrapped inside `#if WATCHDOG_CONF_ENABLE` guards, we control
things from within the WDT driver itself.

This commit also includes some minor documentation and
indentation cleanups
2014-05-18 14:12:16 +02:00
George Oikonomou
b864ec2b71 Merge pull request #661 from hexluthor/watchdog-enable
CC2538: Add WATCHDOG_CONF_ENABLE to optionally disable the watchdog timer
2014-05-18 14:11:49 +02:00
George Oikonomou
026864d129 Merge pull request #665 from hexluthor/cc2538-flash-conf
CC2538: Add FLASH_CONF_ORIGIN and FLASH_CONF_SIZE config parameters.
2014-05-18 13:12:49 +02:00
Nicolas Tsiftes
73086e34f7 Merge pull request #632 from nfi/verbosity-control-stm32w
Add support for verbosity control for building STM32W-based platforms
2014-05-07 16:12:12 +02:00
Ian Martin
2abaeaa8cc CC2538: Add FLASH_CONF_ORIGIN and FLASH_CONF_SIZE config parameters. 2014-05-02 11:35:58 -04:00
Ian Martin
7081440eff CC2538: Add WATCHDOG_CONF_ENABLE to optionally disable the watchdog timer. 2014-05-02 10:28:30 -04:00
Oliver Schmidt
5829bc5159 Adjustment to cc65 change. 2014-05-01 21:32:32 +02:00
George Oikonomou
08c884afa0 Improve the CC2538 extended RF API implementation
* Decouple 64-bit address from LINKADDR_SIZE
* get and set object from/to the start/end of the src/dest buffer
* We expect size == 8 (rather than size < 8) for both get_ and set_object. Error otherwise
* The RF no longer sets parameters by itself. We let the platform do this, using the extended API.
2014-04-23 12:20:16 +01:00
George Oikonomou
6028c0765f Don't hardcode min and max TX power values 2014-04-23 12:16:50 +01:00
George Oikonomou
3183805ba4 Implement extended RF API for the CC2530 RF 2014-04-23 12:16:50 +01:00
George Oikonomou
b0f1199202 Merge pull request #636 from g-oikonomou/fix-random-init-lockup
Fix CC2538 random_init lockup
2014-04-18 13:28:40 +01:00
George Oikonomou
49bf7cc241 Merge pull request #616 from hexluthor/listing
CC2538: Add a Makefile rule to generate a final assembly listing.
2014-04-17 22:13:52 +01:00
Benoît Thébaudeau
d93d129da6 cc2538: uart: Make it possible to use several UARTs simultaneously
This avoids the limitation of having a single UART available at runtime, without
duplicating code.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2014-04-17 18:53:44 +02:00
Brad Campbell
af27d2d252 [CC2538-SPI] Implement SPI_FLUSH, spi mode, !CS
Because the CC2538 has a multi-byte SPI RX FIFO, flushing the buffer
requires more than just a single read. This adds a loop that empties the
entire RX buffer on a FLUSH().

Different SPI chips needs different SPI settings. This commit adds a
function that allows chip drivers to configure the SPI peripheral before
using it.

The frame pin the driver was using as a chip select does not work as
most devices expect it to. It toggles after every byte, and most chips
interpret that as end of message. To make drivers more reliable, each
chip driver should setup a GPIO and assert it as needed.
2014-04-15 14:07:10 -04:00
Nicolas Tsiftes
19cd33664d Merge pull request #633 from nfi/verbosity-control-msp430
Add support for verbosity control for building MSP430-based platforms with the IAR compiler.
2014-04-14 16:38:07 +02:00
George Oikonomou
0ec1eda75e Implement extended RF API for the CC2538 2014-04-14 15:25:30 +02:00
Niclas Finne
f0c48c55ca Fixed STM32W radio to return RADIO_RESULT_INVALID_VALUE if trying to
set a transmission power outside the valid range instead of using
closest valid value.
2014-04-13 21:36:45 +02:00
George Oikonomou
602f834caf Merge pull request #472 from ADVANSEE/cc2538-clock-adjust-etimer-poll
cc2538: clock: Fix clock / timer issues with PM1/2
2014-04-13 16:35:17 +01:00
George Oikonomou
eed1352282 Fix CC2538 random_init lockup
Contiki sometimes fails to boot correctly and locks up in
random_init()

This problem only manifests itself for specific versions
of the arm-gcc toolchain and then again only for specific
levels of optimisation (-Os vs -O2, depending on the
value of the SMALL make variable)

The lockup is caused when we write an RFCORE XREG before
the RF clock ungating has taken effect, which in turn
only occurs depending on the assembly generated for those
two instructions:

  REG(SYS_CTRL_RCGCRFC) = 1;

  REG(RFCORE_XREG_FRMCTRL0) = 0x00000008;

This commit makes the RNG wait for the ungating to take
effect before attempting to write the register
2014-04-13 14:38:00 +01:00
George Oikonomou
33abe26ec8 Merge pull request #411 from ADVANSEE/cc2538-adc
cc2538: Add adc driver and example
2014-04-13 03:05:12 +01:00
George Oikonomou
22554e6d72 Merge pull request #596 from hexluthor/cc2538-uart-baudrate
cc2538: Support any UART baudrate.
2014-04-13 02:51:58 +01:00
Niclas Finne
757950f87f Set the RAM and flash size based on the CPU configuration for STM32W 2014-04-11 17:41:09 +02:00
Niclas Finne
0122373fdc OBJECTDIR is defined by Makefile.include 2014-04-11 17:41:08 +02:00
Niclas Finne
4e7abb09c2 Support verbosity control when building for STM32W-based platforms 2014-04-11 17:41:06 +02:00
Niclas Finne
2c953c3346 Support verbosity control when building MSP430-based platforms with
the IAR compiler.
2014-04-11 17:36:42 +02:00
Niclas Finne
207f1987ee Implemented radio rx mode parameter for STM32W, changed the byte order
of the 64 bit address to big-endian.
2014-04-11 14:46:48 +02:00
Nicolas Tsiftes
1b49b68c3b Merge pull request #606 from atiselsts/master
Fix MCU clock calibration in msp430f2xxx based platforms (e.g. Zolertia Z1)
2014-04-09 21:52:08 +02:00
Niclas Finne
4834816306 Added radio parameter RADIO_PARAM_CCA_THRESHOLD for STM32W 2014-04-08 16:42:18 +02:00
Niclas Finne
441beb8f74 Added stub for extended radio API for rl78 2014-04-03 13:38:28 +02:00
Niclas Finne
2dc4d06078 Added stub for extended radio API for mc1322x 2014-04-03 13:38:26 +02:00
Niclas Finne
14ffa35b3f Added stub for extended radio API for cc253x 2014-04-03 13:38:25 +02:00
Niclas Finne
a98e153e23 Added stub for extended radio API for cc2538 2014-04-03 13:38:23 +02:00
Niclas Finne
1fdb04e10c Added stub for extended radio API for cc2430 2014-04-03 13:38:21 +02:00
Niclas Finne
cb3e053232 Added stub for extended radio API for rf230 2014-04-03 13:38:20 +02:00
Niclas Finne
fa908dcaff Added extended radio API implementation for STM32W 2014-04-03 13:38:09 +02:00
Ian Martin
56d0dfdc7a CC2538: Add a Makefile rule to generate a final assembly listing. 2014-04-02 18:17:49 -04:00
Niclas Finne
279b7fd040 Added rule to autocompile mspsim if needed and show warning if submodule MSPSim has not been initialized 2014-03-28 11:11:51 +01:00
Oliver Schmidt
a630fbd5da Removed unused variable. 2014-03-27 19:24:23 +01:00
Atis Elsts
68b65e6c47 Fix CPU clock calibration in msp430f2xxx based platforms (e.g. Zolertia Z1).
The following problems were present in the existing DCO calibration algorithm:

Problem #1. In function msp430_quick_synch_dco(), the "for(i=0; i < 1000; i++) { .. }" loop is optimized away by the compiler, as i is not volatile. Making i volatile would improve the results, but would not be sufficient: see the next point.

Problem #2. According to MSP430F2617 Device Erratasheet, bug BCL12 precludes a naive implementations of "fast" calibration altogether. The bug is present on all MCU revisions up to date.

The description of the bug:
"After switching RSELx bits (located in register BCSCTL1) from a value of >13 to a value of <12 OR from a value of <12 to a value of >13, the resulting clock delivered by the DCO can stop before the new clock frequency is applied. This dead time is approximately 20 us. In some instances, the DCO may completely stop, requiring a power cycle.

Furthermore, if all of the RSELx bits in the BSCTL1 register are set, modifying the DCOCTL register to change the DCOx or the MODx bits could also result in DCO dead time or DCO hang up."

In Contiki code for msp430f2xxx @ 8MHz, the RSEL search currently typically goes from 15 down to 11, thus violating the rules.

Step-by-step RSEL change is proposed as the best possible workaround:
"[..] more reliable method can be implemented by changing the RSEL bits step by step in order to guarantee safe function without any dead time of the DCO."

Problem #3. The old Contiki code started from the highest possible calibration values: RSEL=15, DCOx=7. According to MSP430F2617
datasheet, this means that the DCO frequency is set to 26 MHz. For one, Vcc under 3V is not supported for this frequency, so this means that battery-powered nodes have a big problem. The minimal operating voltages are:
- 1.8V for RSEL <= 13
- 2.2V for RSEL = 14
- 3.0V for RSEL = 15
So the correct way is to always start calibration from RSEL <= 13, unless explicityly pre-calibred values are present.

Problem #4. Timer B should be turned off after the calibration, following the "Principles for Low-Power Applications" in MSP430 user's Guide.

The patch fixes these issues by performing step-by-step calibration and turning off Timer B afterwards. As opposed to MSP430F1xxx calibration, this algorithm does not change the ACLK divider beforehand; attempts to make calibration more precise would lead to looping in some cases, as the calibration step granularity at larger frequencies is quite big.

Additionally, the patch improves DCOSYNCH_CONF_ENABLED behavior, allowing the resynchronization to correct for more than one step.
2014-03-25 11:47:13 +01:00
Ian Martin
336224633a Eliminate UART_CONF_IBRD and UART_CONF_FBRD. 2014-03-22 10:26:03 -04:00
Ian Martin
ee45fc7533 Change uart_set_baudrate() to a do-while statement. 2014-03-22 10:22:11 -04:00
Ian Martin
1ceb8ae358 Fix rounding error in baudrate calculation. 2014-03-22 10:21:54 -04:00
Oliver Schmidt
370650baa3 Updated cc65 URL. 2014-03-15 16:55:39 +01:00
Ian Martin
e3c19714d4 cc2538: Support any UART baudrate. 2014-03-14 16:06:24 -04:00