Jose Alamos
3c56cdf0c0
cc2538_rf/radio_hal: fix transmit function
...
This commit sets the correct value to the MCU_CTRL bit for the
cc2538_rf. This variable is used to detect when the radio is doing
transmission with CCA. Since this was not set to 1 when sending without
CCA, the `confirm_transmit` function returned -EAGAIN after the TX_DONE
event (which violates the HAL API).
This error was discovered using some Radio HAL riotctrl scripts by @LarsKowoll.
2021-01-14 10:34:50 +01:00
José Alamos
2bf10413d0
Merge pull request #15397 from fjmolinas/pr_ieee802154_crc_error
...
sys/net/iee802154/radio: add IEEE802154_RADIO_INDICATION_CRC_ERROR
2021-01-14 10:29:17 +01:00
Francisco Molina
fe1e16cdc7
sys/net/iee802154/radio: add IEEE802154_RADIO_INDICATION_CRC_ERROR
2021-01-13 23:42:41 +01:00
Francisco Molina
f8bc934785
cpu/cc2538/radio/cc2538_rf_radio_ops: fix rssi reporting
2021-01-13 19:45:11 +01:00
benpicco
89c32e5be2
Update cpu/cc2538/include/cc2538_eui_primary.h
...
Co-authored-by: Marian Buschsieweke <maribu@users.noreply.github.com>
2020-12-14 15:23:13 +01:00
Benjamin Valentin
fe9ae5bc80
net/eui_provider: provide index to the callback function
...
If the same callback function is used for multiple interfaces
(`NETDEV_INDEX_ANY`), it is necessary to also provide the index of
the interface to hand out and address.
2020-12-14 00:22:18 +01:00
benpicco
e6a4d0a4d5
Merge pull request #15569 from fjmolinas/pr_cc2538_uart_nonblocking
...
cpu/cc2538: add periph_uart_nonblocking
2020-12-11 10:57:36 +01:00
Francisco Molina
bc737a1f76
cpu/cc2538: add periph_uart_nonblocking
...
Add periph_uart_nonblocking. Since cc2538 has a transmit FIFO write
to the FIFO first and to a tsrb buffer only when the transmit FIFO
is full.
Rely on the FIFO TXIFLSEL condition to fill up FIFO as space becomes
available.
2020-12-11 09:36:16 +01:00
Jose Alamos
28ca3e202f
cc2538_rf: default to netdev_ieee802154_submac
2020-12-01 13:20:49 +01:00
6e658868e0
cpu/cc2538: enable UART IRQ only if cb is not NULL
2020-11-28 10:30:33 +01:00
Francisco
fe510cd823
Merge pull request #15439 from leandrolanzieri/pr/drivers/network_devices_remove_netif_dep
...
drivers/network devices: remove unused netif dependency
2020-11-17 12:06:18 +01:00
f626758aaf
Merge pull request #15392 from fjmolinas/pr_cc2538_riotboot
...
boards/cc2538: add riotboot feature
2020-11-13 15:39:55 +01:00
Francisco Molina
8598176544
boards: add riotboot to cc2538 based boards
2020-11-13 14:51:58 +01:00
Francisco Molina
ab9abf2f51
cpu/cc2538: add riotboot
...
Flash Customer Configuration Area (CCA) is never written when the
riotboot module is used. This required a riot application to have
been previously flashed. riotboot will completely ignore this
section, neither writing or erasing it.
Slot flashing is currenly only supported with Jlink.
Co-authored-by: Brenton Chetty <brent7984@gmail.com>
2020-11-13 14:51:57 +01:00
Leandro Lanzieri
0e52e2747e
drivers: remove netif as dependency for network device drivers
2020-11-13 09:25:59 +01:00
3c10425b4c
cc2538: Adapt to flashpage/flashpage_pagewise API
2020-11-11 23:16:38 +01:00
Francisco Molina
c4edff3a59
boards cpu: move OpenWSN defintions to openwsn_defs.h
2020-11-10 07:46:35 +01:00
Francisco Molina
dcfc7f1158
cpu/cc2538: add flashpage & flashpage_raw
2020-11-06 18:00:17 +01:00
Marian Buschsieweke
125c892c03
drivers/periph/timer: Use uint32_t for frequency
...
For all currently supported platforms `unsigned long` is 32 bit in width. But
better use `uint32_t` to be safe.
2020-10-30 22:02:12 +01:00
José Alamos
e8721ce415
Merge pull request #15145 from fjmolinas/pr_openwsn_radio_hal
...
pkg/openwsn: add ieee802154_hal based radio
2020-10-23 21:26:21 +02:00
Francisco Molina
e06ef467d9
cpu/cc2538/include/cc2538_rf.h: fix typo
2020-10-23 15:31:58 +02:00
Francisco Molina
1b8c78219b
cpu/cc2538/cpu_conf: add OpenWSN conf
2020-10-23 15:31:56 +02:00
Bas Stottelaar
22243aec7a
cpu/*: realign ENABLE_DEBUG
2020-10-23 00:46:26 +02:00
Francisco Molina
e2c57cde95
cpu/cc2538: cleanup init, add cc2538_rf_obs_sig module
2020-10-22 18:17:08 +02:00
Francisco Molina
145d24499d
cpu/cc2538_rf: remove RADIO_IRQ_PRIO
2020-10-22 17:26:08 +02:00
José Alamos
9fd49581e7
Merge pull request #15140 from fjmolinas/pr_tx_start_radio_hal
...
sys/net/ieee802154/radio: add IEEE802154_RADIO_INDICATION_TX_START
2020-10-22 16:57:27 +02:00
Francisco Molina
0175abc8e5
cc2538/cc2538_rf_radio_ops: add TX/RX_START
2020-10-22 14:59:06 +02:00
Bas Stottelaar
fb61443bbd
cpu/*: remove unused assert.h include
2020-10-22 11:13:09 +02:00
Bas Stottelaar
ab6188cea3
cpu/*: add missing include of assert.h
2020-10-22 11:13:08 +02:00
Jose Alamos
fa0dd8b5e2
netdev_ieee802154_submac: set addresses using netdev_register
2020-10-19 15:18:35 +02:00
Jose Alamos
c1a9d352f3
cc2538_rf: unify auto_init for HAL and netdev
2020-10-19 15:18:34 +02:00
benpicco
0f726b17d5
Merge pull request #15228 from jia200x/pr/hal_read_func
...
ieee802154/radio: add `read` function
2020-10-15 21:31:10 +02:00
Jose Alamos
ee5adad401
ieee802154/radio: replace indication mechanism
2020-10-14 18:07:28 +02:00
Francisco Molina
8df42f2390
cpu/cc2538: add RTT_MIN_OFFSET
2020-10-02 12:49:15 +02:00
Francisco Molina
eb8f747a34
cpu/cc2538: reset rtt on init
2020-10-02 12:49:06 +02:00
Benjamin Valentin
d9116684e5
cpu/cortexm_common: advertise puf_sram feature
...
`puf_sram` is a feature of the linker script, it does not need vendor
specific hardware support.
2020-09-11 16:30:45 +02:00
Benjamin Valentin
a1a67265cd
cc2538_rf: use prefix for global function name
2020-09-11 13:33:37 +02:00
Benjamin Valentin
8ac3332cb6
cc2538_rf: add EUI provoder for primary EUI-64
2020-09-11 13:33:37 +02:00
Benjamin Valentin
1811686540
cc2538_rf: register with netdev
2020-09-11 13:33:37 +02:00
Benjamin Valentin
6675c5f5c0
cc2538_rf: pass address via pointer
2020-09-11 13:33:37 +02:00
benpicco
84e36e6fcc
Merge pull request #14985 from jia200x/pr/hal/cc2538_rf/fix_style_issues
...
cc2538_rf_hal: fix style issues
2020-09-09 17:41:02 +02:00
Jose Alamos
9d770ec1bd
cc2538_rf_hal: fix style issues
2020-09-09 13:07:58 +02:00
Jose Alamos
d3630dcabe
cc2538_rf: add missing const qualifiers
2020-09-09 11:18:01 +02:00
63554b1a0c
cpu/cc2538/radio: only build required files
2020-09-04 15:25:36 +02:00
Jose Alamos
1401635787
cc2538: implement radio hal
2020-09-04 11:09:17 +02:00
Jose Alamos
18d188c5d9
cc2538: add IRQ bit definitions
2020-09-03 18:20:50 +02:00
Jose Alamos
2d7c316226
cc2538_netdev: disable netdev if radio hal is present
2020-09-03 18:20:50 +02:00
Jose Alamos
2917879407
cc2538: move chunks of init function to netdev
2020-09-03 18:20:49 +02:00
Jose Alamos
4cbd3a91b2
cc2538: move IRQ clear to netdev irq handler
2020-09-03 18:20:49 +02:00
Benjamin Valentin
18fe16298c
cpu/cc2538: add Watchdog implementation
...
The Watchdog on the CC2538 only supports 4 intervals (2ms, 16ms, 250ms & 1s).
Since the watchdog timer API specifies a `max_time`, the interval equal or
below that time is selected.
E.g. for `max_time=125ms` the 16ms interval would be selected.
This is outside the tolerance of the `tests/periph_wdt` test.
Co-authored-by: Thomas Geithner <thomas.geithner@dai-labor.de>
2020-08-30 11:46:39 +02:00
Francisco Molina
8ed8daa493
cpu/cc2538/timer: fix 32 bit timer reload value
...
The interval load value was only set to 0xffff regardless of the counter
mode used which mad the 32bit timer apparently stop after 0xffff (it
would never reach values >0xffff).
When a GPTM is configured to one of the 32-bit modes, TAILR appears as a
32-bit register (the upper 16-bits correspond to the contents of the
GPTM Timer B Interval Load (TBILR) register). In a 16-bit mode, the
upper 16 bits of this register read as 0s and have no effect on the
state of TBILR.
Thsi commit set the correct value for TAILR depending on the configured
timer mode.
2020-08-12 11:35:42 +02:00
Marian Buschsieweke
234a720571
Merge pull request #14516 from benpicco/bitband_hw
...
cortexm_common: fix check for bitbanding feature
2020-08-08 14:26:49 +02:00
Benjamin Valentin
b8d49fe627
cpu/cc2538: set CPU_HAS_BITBAND
2020-08-08 12:44:11 +02:00
Benjamin Valentin
a8d5f13ad9
cpu/cc2538: rtt: allow to set alarm and overflow cb independently
...
Previously the setting the alarm would overwrite the overflow callback
and vice versa.
Since we can only set one alarm in hardware, always set the alarm to the
closest event of the two.
2020-08-04 16:22:44 +02:00
Benjamin Valentin
852fd7f531
cpu/cc2538: rtt: implement rtt_get_alarm()
...
We can't read back the alarm, so just store it in a variable.
2020-08-04 16:21:19 +02:00
Benjamin Valentin
d7f722e98f
cpu/cc2538: rtt: implement rtt_set_counter()
...
We can't set the hardware counter directly, so always add an offset.
2020-08-04 16:21:17 +02:00
Peter Kietzmann
6adf07caf0
Merge pull request #14672 from jia200x/pr/fix_cc2538_rssi
...
cc2538: fix RSSI offset
2020-08-03 09:45:16 +02:00
Jose Alamos
519f8f4529
cc2538: fix RSSI offset
2020-07-31 16:08:04 +02:00
Benjamin Valentin
08b3e2bd6b
cpu/cc2538: GPIO: use bitarithm_test_and_clear()
2020-07-28 12:44:23 +02:00
Francisco Molina
da171f2254
cpu/cc2538/uart: uart_write wait for all bytes to be sent
...
uart_write should block until all bytes are sent out, so wait for
transmit fifo to empty before returning.
2020-07-22 12:56:12 +02:00
Benjamin Valentin
9d836888c2
treewide: fix file permissions
...
C files should not be executable.
2020-07-08 17:32:36 +02:00
Leandro Lanzieri
7d543fe091
cpu/cc2538: Add Kconfig symbols
...
Also specify CPU_FAM in Makefile.features
2020-06-24 15:15:43 +02:00
Leandro Lanzieri
4d65bc8e0a
cpu: Rename CPU_ARCH to CPU_CORE
2020-06-16 12:05:40 +02:00
Matthew Bradbury
ba51e90228
cpu/cc2538: Flush the RX FIFO (if overflowed) after a receive
2020-04-20 18:19:23 +01:00
Matthew Bradbury
bcfb437746
cpu/cc2538: Do not check XREG_RSSISTATbits for RSSI_VALID
2020-04-20 18:18:56 +01:00
Matthew Bradbury
ecfe4a4e8f
cpu/cc2538: Check CRC of received message after reading message contents
2020-04-20 18:18:56 +01:00
Matthew Bradbury
fc0581056a
cpu/cc2538: Check for a minimum length to read from a received frame
2020-04-20 18:18:56 +01:00
Matthew Bradbury
f0e48f0741
cpu/cc2538: Prevent underflow of the RX FIFO
2020-04-20 18:18:53 +01:00
Jose Alamos
77325b4cde
ieee802154: add CONFIG_ prefix to config macros
2020-04-08 19:08:25 +02:00
Leandro Lanzieri
64552a3b9a
cpu/cortexm_common: Move common modules to Makefile.dep
...
This moves the following modules to a architecture-specific Makefile.dep
file:
- cortexm_common
- cortexm_common_periph
- newlib
- newlib_nano
- periph
2020-04-01 09:46:21 +02:00
Francisco Molina
dcd6b7f226
cpu/cc2538/timer: fix GPT enabling wait
2020-03-25 20:16:23 +01:00
benpicco
e9b71254ff
Merge pull request #13694 from fjmolinas/pr_boards_common_cc2538
...
boards: add common cc2538
2020-03-25 11:11:50 +01:00
Francisco Molina
194af687a0
boards/common: add cc2538
2020-03-25 08:20:52 +01:00
benpicco
457c5245ce
Merge pull request #13507 from benpicco/cpu/cc2538-gpio-cycles
...
cpu/cc2538: gpio: save a few cycles in handle_isr()
2020-03-23 20:53:52 +01:00
Francisco Molina
0cc6a51ea8
cpu/cc2538/periph/timer: cleanup styling
2020-03-23 10:59:53 +01:00
Francisco Molina
7e913fe0d9
cpu/cc2538/periph/timer: set pending timer_set_absolute
...
GPT timer needs to be gated to write to TnMATCHR register. If set
when timer is stopped save values and set on next timer_start()
2020-03-23 10:59:30 +01:00
Francisco Molina
ce696c6caa
cpu/cc2538/timer: enable GPT clock in active, sleep and PM0
2020-03-23 10:58:56 +01:00
Benjamin Valentin
345827ce7b
cpu/cc2538: gpio: save a few cycles in handle_isr()
...
If only one it is set in state (one GPIO pin caused an interrupt),
don't loop over all 8 bits.
Use clz to get the position of the first interrupt bit and clear it,
looping only as many times as there are actual interrupts.
2020-03-23 09:21:14 +01:00
Francisco Molina
9a2190cd24
cpu/cc2538/periph/pm: unset OSC_PD when running on 32Mhz
...
Setting OSC_PD before WFI allows for faster wakeup from sleep.
Wait for cc2538_sys_ctrl_clk_sta and not cc2538_sys_ctrl_clk_ctrl
to be set.
2020-03-21 19:32:24 +01:00
Francisco Molina
8c35335668
cpu/cc2538/cpu: cleanup clock intialization
2020-03-21 19:32:22 +01:00
Francisco
b98e4bf0d1
Merge pull request #13658 from fjmolinas/pr_periph_timer_cc2538
...
cpu/cc2538: fix GPT3 IRQ definition
2020-03-20 14:31:05 +01:00
Gunar Schorcht
df19c6d1b4
Merge pull request #13519 from benpicco/rtt_rtc
...
drivers/rtt_rtc: add RTT based RTC implementation, enable it for cpu/cc2538, nrf5x_common
2020-03-19 17:18:43 +01:00
Francisco Molina
226e1b5daf
cpu/cc2538: fix GPT3 timer IRQ definition
2020-03-19 16:31:57 +01:00
Benjamin Valentin
f9346e1e2b
cpu/cc2538: use RTT based RTC implementation
2020-03-19 15:25:14 +01:00
Francisco
d77ecc1cde
Merge pull request #13598 from benpicco/cpu/cc2538-spi-fix
...
cpu/cc2538: fix spi_transfer_bytes()
2020-03-17 17:29:49 +01:00
benpicco
5d038a24bf
Merge pull request #13510 from benpicco/cpu/cc2538-pm
...
cpu/cc2538: implement periph/pm
2020-03-12 12:18:18 +01:00
Dylan Laduranty
077a15f254
cpu/cc2538: use generic hw fc module
2020-03-10 14:22:34 +01:00
Benjamin Valentin
5d8c00e302
cpu/cc2538: implement periph/pm
...
cc2538 implements 4 sleep modes.
In the lightest mode (3) any interrupt source can wake up the CPU.
In mode 2, only RTT, GPIO or USB may wake the CPU.
In mode 1 only RTT and GPIO can wake the CPU.
In mode 0 only GPIO can wake the CPU.
In mode 0 and 1 the lower 16k RAM are lost. This is a problem since those
are usually used by RIOT.
The linkerscripts in cc2538/ldscripts take different approaches towards that.
Some only use the upper 16k and leave the other half to be managed by the
application.
`cc2538sf53.ld` which is used by `openmote-b` uses the entire RAM starting
at the lower half, so it will not be able to wake up from those modes.
A quick fix to test those modes with `tests/periph_pm` would be
--- a/cpu/cc2538/ldscripts/cc2538sf53.ld
+++ b/cpu/cc2538/ldscripts/cc2538sf53.ld
@@ -21,7 +21,7 @@ MEMORY
{
rom (rx) : ORIGIN = 0x00200000, LENGTH = 512K - 44
cca : ORIGIN = 0x0027ffd4, LENGTH = 44
- ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 32K
+ ram (w!rx) : ORIGIN = 0x20004000, LENGTH = 16K
}
2020-03-10 10:35:46 +01:00
Benjamin Valentin
80392dc644
cpu/cc2538: spi: unify spi_transfer_bytes()
...
Use a common helper function to read/write the data register.
2020-03-09 16:37:07 +01:00
Benjamin Valentin
68b2c57d2d
cpu/cc2538: spi: fix spi_transfer_bytes() with in_buf = NULL
...
We have to read the DR for every byte that we write.
Just reading DR while SPI is busy in a loop can lead to bytes being
left in the fifo, corrupting subsequent reads.
2020-03-09 16:22:37 +01:00
benpicco
7396d05605
Merge pull request #13575 from fjmolinas/pr_cc2538_rf_deps
...
cpu/cc2538: handle cc2538_rf deps in Makefile.dep
2020-03-06 18:00:51 +01:00
Francisco Molina
ff6f6618fb
cpu/cc2538: handle cc2538_rf deps in Makefile.dep
2020-03-06 14:17:19 +01:00
Jose Alamos
3ad574a822
drivers/netdev: use netdev_trigger_event_isr function
2020-03-06 14:03:43 +01:00
68ec8b2c2b
Merge pull request #13391 from kaspar030/mpu_feature
...
cpu/cortex-m: turn MPU support into a feature
2020-03-04 07:09:40 +01:00
a3c527fdbc
cpu/*: add cortex_mpu to known-to-support CPU families
2020-03-03 22:59:41 +01:00
Francisco
3f062a78b2
Merge pull request #13045 from aabadie/pr/boards/remote_factorize
...
boards/remote*: cleanup and factorize code in peripheral configuration headers
2020-03-03 13:21:04 +01:00
d7c0102115
cpu/cortexm: move CPU_ARCH/FAM to Makefile.features
2020-02-17 16:02:48 +01:00
Gunar Schorcht
42db6861e1
cpu/cc2538: fix I2C compilation error with NDEBUG
...
When NDEBUG macro is defined during compilation, the assert macro produces empty code. The dev parameter is then unused.
2020-01-30 11:57:36 +01:00
Marian Buschsieweke
c4a84f01c0
cpu/cc2538/periph: adc_sample() now returns int32_t
2020-01-10 14:13:14 +01:00
82d1d40042
cpu/cc2538: define radio irq prio at cpu level
2020-01-08 14:41:01 +01:00