1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

32839 Commits

Author SHA1 Message Date
Gilles DOFFE
d78e13e906 cpu/stm32: add stm32mp1 support to clk_conf
clk_conf is a useful tool to produce clock headers for new boards.
But it only supports STM32Fx families.
This commits add the definition of a new family: STM32MP1.
Only the STM32MP157 is supported for now.

First build clk_conf:
$ make -C cpu/stm32/dist/clk_conf/

Clock header can be generated with the following command once clk_conf is
built:
$ cpu/stm32/dist/clk_conf/clk_conf stm32mp157 208000000 24000000 1
This command line will produce a core clock of 208MHz with a 24MHz HSE
oscillator and will use LSE clock which corresponds to the STM32MP157C-DK2
board configuration.
The command will output the header to copy paste into the periph_conf.h of
the board:

/**
 * @name    Clock settings
 *
 * @note    This is auto-generated from
 *          `cpu/stm32/dist/clk_conf/clk_conf.c`
 * @{
 */
/* give the target core clock (HCLK) frequency [in Hz],
 * maximum: 209MHz */
#define CLOCK_CORECLOCK     (208000000U)
/* 0: no external high speed crystal available
 * else: actual crystal frequency [in Hz] */
#define CLOCK_HSE           (24000000U)
/* 0: no external low speed crystal available,
 * 1: external crystal available (always 32.768kHz) */
#define CLOCK_LSE           (1U)
/* peripheral clock setup */
#define CLOCK_MCU_DIV       RCC_MCUDIVR_MCUDIV_1     /* max 209MHz */
#define CLOCK_MCU           (CLOCK_CORECLOCK / 1)
#define CLOCK_APB1_DIV      RCC_APB1DIVR_APB1DIV_2     /* max 104MHz */
#define CLOCK_APB1          (CLOCK_CORECLOCK / 2)
#define CLOCK_APB2_DIV      RCC_APB2DIVR_APB2DIV_2     /* max 104MHz */
#define CLOCK_APB2          (CLOCK_CORECLOCK / 2)
#define CLOCK_APB3_DIV      RCC_APB3DIVR_APB3DIV_2     /* max 104MHz */
#define CLOCK_APB3          (CLOCK_CORECLOCK / 2)

/* Main PLL factors */
#define CLOCK_PLL_M          (2)
#define CLOCK_PLL_N          (52)
#define CLOCK_PLL_P          (3)
#define CLOCK_PLL_Q          (13)
/** @} */

This result has been verified with STM32CubeMX, the official ST tool.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
5e30e60fec cpu/stm32: avoid configuring stm32mp1 APB1 clock
APB1 bus clock is always enabled is not manageable by RCC register.
So avoid enabling it.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
7a2550da9b cpu/stm32: add stm32mp1 peripheral busses
Add stm32mp1 peripheral busses AHB1, AHB2, AHB3 and AHB4 with
enable/disable functions.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
67f37950a0 cpu/stm32: default i2c configuration
* Setup i2c speed to I2C_SPEED_LOW by default
* enable i2c_write_regs() function.
* i2c frequency needs to be specified into board periph_conf.h

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
f39aa979af cpu/stm32: setup CLOCK_LSI for stm32mp1
Set stm32mp1 family LSI clock frequency to 32KHz as specified in datasheet.
STM32MP157C example:
https://www.st.com/resource/en/datasheet/stm32mp157c.pdf

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
ba5f8e1cda cpu/stm32: consider starting white spaces in gen_vectors.py
In some CMSIS headers, "typedef enum" could be preceded by white
spaces. Thus consider them when parsing the line.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
cca2d70808 tools/openocd: add stlink-dap adapter
stlink-dap adapter is based on stlink-dap.cfg and is used by
STM32MP1 family.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
8a35e114c0 tools/openocd: add GDB_PORT_CORE_OFFSET variable
In case of muticore CPU, openocd opens one debug port by core for gdb.
Thus add a GDB_PORT_CORE_OFFSET port offset to select the right port
for debugging.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
5424ef1dfe tools/openocd: add flashr action
As for debugr, boards like stm32mp157c-dk2 does not have flash memory.
The firmware could be flashed using the operating system (mainly Linux) or
the bootloader (mainly u-boot) of the dual architecture (cortex-A7 on
stm32mp157c-dk2). However in engineering mode (only cortex-M4), the
firmware has to be flashed using jtag once the board is powered up.
The flashr action do this using openocd only.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
4f3ea5c74c tools/openocd: select target core
For multi-arch SoC like STM32MP1, the right target core has
to be selected to avoid debugging the wrong default cpu.
This is done using openocd command 'targets ${OPENOCD_CORE}'.
OPENOCD_CORE has to be set in board Makefile.include file.
In case it is not set, the command just display available targets, thus it
has no effect on already existing boards using openocd.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
e7b344983d tools/openocd: add debugr action
In case of STM32MP157c-dk2 board, there is no flash available. Thus,
the elf binary has to be flashed directly to SRAM before debugging.
To do so, the DBG_FLAGS variable has to be overrided to load the binary
using 'load' gdb command.
The START_ADDR variable is the entrypoint extracted from the elf binary
using objdump tool.
The do_debug function can now be used as usual.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
4c9ee5d075
Merge pull request #15438 from aabadie/pr/tests/sys_atomic_unittest
tests/unittests: split out atomic_utils unittests
2020-11-13 10:33:44 +01:00
cab254003f
tests/unittests: remove atomic-utils from unittests 2020-11-13 08:47:18 +01:00
996da8fb6d
tests/sys_atomic_utils_unittest: add sys atomic utils unittests 2020-11-13 08:47:18 +01:00
benpicco
d9598a0f54
Merge pull request #15412 from bergzand/pr/flashpage/merge_raw
periph_flashpage: Make pagewise API optional
2020-11-12 22:32:21 +01:00
benpicco
93b978bb66
Merge pull request #15258 from lutgaru/cc26x0setuptrimdevice
Cc26x0setuptrimdevice
2020-11-12 22:20:32 +01:00
792e031a95
Merge pull request #14331 from maribu/atomic_utils
sys/atomic_utils: Functions for atomic access
2020-11-12 21:44:53 +01:00
153c52754d
Merge pull request #15070 from fjmolinas/pr_uwb_core
pkg/uwb_core: initial support
2020-11-12 14:04:51 +01:00
Francisco Molina
421482c8f1
examples/twr_aloha: RIOT adaptation of twr_aloha 2020-11-12 12:54:54 +01:00
Francisco Molina
3622c2da07
pkg/uwb-core: initial import 2020-11-12 12:54:54 +01:00
Francisco Molina
cc0d8a83f1
pkg/uwb-dw1000: initial import 2020-11-12 12:07:20 +01:00
Martine Lenders
37dd848c37
Merge pull request #15337 from cgundogan/pr/uri_parser_interfaces
uri_parser: extend for parsing interfaces in IPv6 addresses
2020-11-12 11:16:52 +01:00
Cenk Gündoğan
d18ad54184
unittests: Makefile.ci: do not link cc1312/52-launchpad 2020-11-12 10:09:17 +01:00
Martine Lenders
71d970cb00
Merge pull request #15245 from haukepetersen/add_driver_ds3231
drivers: add support for DS3231 RTC
2020-11-12 08:58:35 +01:00
722223902a
riotboot: only depend on periph_flashpage 2020-11-11 23:16:43 +01:00
3aa5203bc5
mtd_flashpage: only depend on periph_flashpage
The features in flashpage_raw are now default in flashpage and do not
have to be included as a separate dependency
2020-11-11 23:16:43 +01:00
1c063a74ea
stm32: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:42 +01:00
72d7a903a2
sam0: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:41 +01:00
61052dbed7
msp430: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:41 +01:00
e176649266
nrf5x: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:40 +01:00
f85594eb55
kinetis: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:39 +01:00
9a79124fba
efm32: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:39 +01:00
3c10425b4c
cc2538: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:38 +01:00
5683f30b2f
tests/periph_flashpage: Adapt to optional flashpage_pagewise 2020-11-11 23:16:37 +01:00
Cenk Gündoğan
1da3738619
unittests: uri_parser: extend for interfaces 2020-11-11 22:47:30 +01:00
Cenk Gündoğan
9eb6a38a5a
uri_parser: parse interface in IPv6 addresses 2020-11-11 22:47:30 +01:00
41bbaa7442
flashpage: Make pagewise API optional
flashpage currently requires pagewise implementation with an optional
extension for per block writes (flashpage_raw). Most implementations
with flashpage_raw implement the pagewise access via the flashpage_raw
functions. This commit makes the flashpage raw the main access method
and adds an extension feature for the pagewise access.

The functions and defines are renamed to reflect this. The API is also
extended with a dedicated function for erasing a sector.
2020-11-11 22:26:33 +01:00
6fd4c9d84c
Merge pull request #15432 from benpicco/boards/saml21-xpro-SAUL
boards/saml21-xpro: add gpio_params.h
2020-11-11 19:32:20 +01:00
1f887176a2
Merge pull request #15433 from benpicco/cpu/nrf52-purge_softdevcie
cpu/nrf52: remove softdevice linkerscripts
2020-11-11 19:30:12 +01:00
Benjamin Valentin
d63141fb02 cpu/nrf52: remove softdevice linkerscripts
Support for softdevice was removed in 35b6ccedf3
Those linkerscripts were leftover, they are not used anymore.
2020-11-11 18:18:37 +01:00
Benjamin Valentin
d12a9dbf13 boards/saml21-xpro: add gpio_params.h
We can now enable `saul_gpio`.
2020-11-11 17:40:09 +01:00
Hauke Petersen
24c3f56844 tests: add test for ds3231 RTC driver 2020-11-11 17:39:16 +01:00
benpicco
38552ed41a
Merge pull request #15413 from benpicco/cpu/efm32_rtc_helper
cpu/efm32: RTC Series 0: use RTC helper functions
2020-11-11 17:19:59 +01:00
benpicco
808c5b7eb8
Merge pull request #15424 from basilfx/feature/efm32_fix_timers
boards/efm32: update channel_numof with correct values
2020-11-11 09:49:24 +01:00
Leandro Lanzieri
c068f13ba2
Merge pull request #15234 from akshaim/PR_PKTBUF_Bug
Kconfig/pktbuf :  Fix check for "CONFIG_GNRC_PKTBUF_SIZE"
2020-11-11 09:34:19 +01:00
Leandro Lanzieri
188f2fe0ca
Merge pull request #15425 from basilfx/feature/efm32_cpu_common
boards/common/silabs: define CPU=efm32
2020-11-11 08:55:40 +01:00
Bas Stottelaar
b75446e2f8 tests/periph_rtc: add to list of 32kHz boards 2020-11-11 00:27:18 +01:00
Bas Stottelaar
67e7a14e6c boards/efm32: update channel_numof
The number of channels per timer got updated incorrectly in #15368.
Only TIMER1 and higher have four channels. Without this fix, timer
initialization will halt.
2020-11-11 00:26:52 +01:00
Bas Stottelaar
cc9586f163 boards/common/silabs: define CPU=efm32 2020-11-11 00:24:53 +01:00
Bas Stottelaar
fe941ac9fe
Merge pull request #15299 from basilfx/feature/efm32_add_slwstk6220a
boards/slwstk6220a: add support (via efm32)
2020-11-11 00:18:21 +01:00