Commit graph

156 commits

Author SHA1 Message Date
kywwilson11
04c4f5d229 Initial commit for STM32G0 dma support. Added DMA mux mappings. Added Kconfig for enabling DMA2. Added basic defines for number of channels and mux channels in dma_v1mux.
Added subclasses of STM32G0 (such as STM32G07X) to Kconfig for use in dmamux driver. Added definitions to stm32g0_dmamux.h. Added configuration of number of dma and dmamux channels.

Added missing dma mappings for stm32g0.

Remove reserved defines.

Formatting fixes.

Added DMA2 IRQ mappings for STM32G0B and STM32G0C. Changed STM32_DMAMUX_BASE to STM32_DMAMUX1_BASE to align with stm32_dma_v1mux.c and C0 defines.

Provide correct mapping for ADC1_DMA_CHAN. Add STM32F0L0G0_HAVE_ADC1_DMA to STM32G0.

Add support for continuous mode to the ADC. Also added support to set smp1 and smp2 in board.h, as well as smpsel.

Removed unnecessary selects of STM32F0L0G0_STM32G0. Changed board level files to properly define A0-A3 on nucleo-g0b1re.

Add new Kconfig changes.

Made combined configs for STM32G0. Ex. STM32G0BX for STM32G0B0 and STM32G0B1.

Fixed defines and references in Kconfig and stm32_dma_v1mux.c

Defined adc_sampletime_write and adc_sampletime_set. Changed adc_sample_time_s structure to be much simpler. Old way made no sense. You can only have 2 sample times, so defining one for each channel makes no sense. The new adc_sample_time_s contains smp1, smp2, and smpsel. Also define ADC_HAVE_SMPR_SMP2 for STM32C0.

Added adc_sampletime_write and adc_sampletime_set. Altered adc_sample_time_s structure to be more appropriate for g0 and c0. Only two sample times can be defined. Added rcc support for DMA2.

Added defconfig for nucleo-g0b1re:adc_dma config.

Restore correct Kconfig from my original branch

Removed redundant ifdefs. If we select for G0 and C0, we know they have SMP2. Fixed formatting.

Formatting feedback. Aligned columns in irq and dma headers.
2025-06-23 15:46:28 +08:00
Tyler Bennett
54b7bf6e36 ADC Hardware register file updated for G0
First commit of ADC for G0. Have it working basically. Need to make changes regarding adccmn stuff.

Added changes to make stm32_adc.c compatible with both G0 and other families.

Add oversampling support. This is for G0 and L0. Add ADC oversampling to Kconfig. Use adccmn_modifyreg for all, updated hw file to accomodate G0.

Style fixes. Move init of oversampling to a function, and call it if OVERSAMPLE is configured.

Limited changes to stm32_bringup.c

Style fixes to hardware/stm32_adc.h

Changed nucleo-g0b1re to run at 64 MHz. Fixed errors in clock setup. Added defines for setting up ADC clock.

Added code for STM32G0 ADC clock configuration.

Added adc_ckmode_cfg function. ckmode bits were previously neglected, assuming async clock to ADC was used. Added other feedback from pull request #16500.

Added feedback from pull request #16500.

Changed format of STM32F0L0G0_HAVE_ADC_OVERSAMPLE config.

Removed FARs from ioc_set_oversample.

Fixed formatting of helps in Kconfig. Adjusted spacing on help content.

Simplified adc_common_cfg. CCR_PRESC relies on board.h

Fixed formatting

Add ADC pinmaps for stm32g0
2025-06-17 21:25:39 +08:00
raiden00pl
64c7354853 boards/nucleo-c0{71rb|92rc}: add clock definition for timers
add clock definitions for TIMERS in nucleo-c071rb adn nucleo-c092rc

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-06-13 12:10:13 -03:00
raiden00pl
13fba11e9b boards/nucleo-c092rc: add FDCAN examples
add FDCAN examples for nucleo-c092rc based on
SocketCAN interface and CAN character driver interface.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-06-09 15:26:12 -03:00
Lars Kruse
3ce85ca54e style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
Tyler Bennett
94a62cb5a7 boards/stm32f0l0g0: Add Nucleo G0B1RE support
The Nucleo G0B1RE is a development board using the STM32G0B1RE MCU.
This commit adds a basic nsh over serial configuration.
2025-05-07 02:03:19 +08:00
dongjiuzhu1
c2abe4e994 boards/defconfig: remove unused config about dd
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:26 +08:00
raiden00pl
1b9e6a8563 boards/nucleo-c092rc: add minimal NSH configuration
add minimal NSH configuration for nucleo-c092rc

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-10 22:37:13 +08:00
raiden00pl
e474569472 boards/nucleo-c071rb: add minimal NSH configuration
add minimal NSH configuration for nucleo-c071rb

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-10 22:37:13 +08:00
raiden00pl
8bdb13a31d boards/arm: add nucleo-c092rc board support
add nucleo-c092rc board support

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-10 22:37:13 +08:00
raiden00pl
0de4bd7938 boards/stm32f0l0g0: unify liker scripts
Unify liker scripts for all stm32f0l0g0.

This fixes crash due to unaligned access to rodata for these boards.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-09 20:05:27 +08:00
raiden00pl
b81c4d3aa6 boards/nucleo-c071rb: add watchdog support
boards/nucleo-c071rb: add watchdog support and enable IWDG for jumbo configuration

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-07 23:28:47 +08:00
raiden00pl
c061bb08c4 boards/arm: add nucleo-c071rb support
add nucleo-c071rb support

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-05 11:23:40 -03:00
wangjianyu3
f3b31ef1df boards: Replace CONFIG_NSH_LINELEN with CONFIG_LINE_MAX
Details: https://github.com/apache/nuttx-apps/pull/2943

1. find boards/ -name defconfig | xargs sed -i 's/CONFIG_NSH_LINELEN/CONFIG_LINE_MAX/g'
2. ./tools/refresh.sh --silent --defaults all

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-15 00:07:58 +08:00
Alin Jerpelea
56b71deadc boards/arm/stm32f0l0g0: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-11-10 01:12:34 +08:00
raiden00pl
50f21f93d4 boards/arm/stm32f0l0g0/stm32g071b-disco: fix djoy example
fix djoy example for stm32g071b-disco.
CONFIG_NSH_ARCHINIT=y must be set to register djoy.
2024-10-05 17:29:16 -03:00
guoshichao
4c01594d5b nuttx: remove the unnecessary -pipe build option
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-31 10:22:20 +08:00
cuiziwei
e21885b84a nuttx/boards:Uniform initialization format for init_array.
(1) Keep the `.init_array` and `.ctors` symbols and sort them according to their initialization priority.
(2) Exclude symbols ending with crtend.* and crtbegin.* to support c++
application.if we not exclude crtend.* crtbegin.* frame_dummy will be
added when enable any c++ application with global variables, this symbol
execution is problematic, removing it does not affect the application.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-08-19 19:48:32 +08:00
cuiziwei
4ec7af779d nuttx/boards:init_array.* needs to be executed in order
When I try to set priorities in certain programs, such as init_priority(HIGH_PRIORITY), I've noticed that during linking, there's no guarantee that the programs will be compiled in the sequence I've specified based on priority. This has led to some runtime errors in my program.

I realized that in the ld file, when initializing dynamic arrays, there's no assurance of initializing init_array.* before init_array. This has resulted in runtime errors in the program. Consequently, I've rearranged the init_array.* in the ld file of NuttX to be placed before init_array and added a SORT operation to init_array.* to ensure accurate initialization based on priorities during linking.
2023-08-29 22:54:37 +08:00
raiden00pl
77716ee264 Documentation: migrate STM32L0 2023-08-23 23:21:54 +08:00
raiden00pl
44f288a37c Documentation: migrate STM32G0 2023-08-23 23:20:52 +08:00
raiden00pl
8da255309b Documentation: migrate STM32F0 2023-08-23 23:20:08 +08:00
Xiang Xiao
6b4e5c0d15 binfmt: Change the default of BINFMT_DISABLE to DEFAULT_SMALL
to optimize the image size when and DEFAULT_SMALL is enabled
and refresh the defconfig in boards/

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-10 11:35:41 +03:00
cuiziwei
25eb09c3bb nuttx/boards:add KEEP to *(.init_array .init_array.*)
replace *(.init_array .init_array.*) with KEEP(*(.init_array .init_array.*)).

The KEEP statement within a linker script will instruct the linker to keep the specified section, even if no symbols inside it are referenced. This statement is used within the SECTIONS section of the linker script. This becomes relevant when garbage collection is performed at link time, enabled by passing the --gc-sections switch to the linker. The KEEP statement instructs the linker to use the specified section as a root node when creating a dependency graph, looking for unused sections. Essentially forcing the section to be marked as used.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-05 05:02:25 -07:00
raiden00pl
dffb472ad9 cmake: port stm32f0l0g0 2023-07-24 10:13:26 -07:00
Xiang Xiao
a51be33a41 libc/tls: Change the default value of TLS_NELEM to zero
to ensure the default config as small as possible.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-20 08:11:30 +02:00
Xiang Xiao
0eeca0f375 build: Replace "$(shell $(INCDIR) $(CC) ...)" with $(INCDIR_PREFIX)
to unify the way to get include directories

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 00:11:25 +03:00
raiden00pl
7cf52139e8 boards/stm32f0l0g0: rework boards to not use CONFIG_STM32F0L0G0_USE_LEGACY_PINMAP=y
Continuation to PR #8992
2023-05-24 22:30:45 +08:00
Xiang Xiao
7a8cf7ff70 Indent the include statement by two spaces
follow the coding style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-16 12:34:32 -03:00
Xiang Xiao
66c5f86018 sched: Disable stdio api by default when DEFAULT_SMALL equals y
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-03 00:18:03 +02:00
Xiang Xiao
df102d1f06 Remove OK macro from the code base
let's use OK from sys/types.h instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-02 13:58:16 +01:00
Xiang Xiao
28947517ca sched/spawn: Rename task_spawnattr_[get|set]stack[size|addr] to posix_spawnattr_[get|set]stack[size|addr]
since they can be not only used in task_spawn but also in posix_spawn

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 09:51:18 +09:00
Xiang Xiao
7923ea3bef boards: Refresh defconfig after the default value of FS_PROCFS_EXCLUDE_xxx
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 15:10:26 +09:00
Xiang Xiao
af12a552fe sched/Kconfig: let PREALLOC_TIMERS depends on !DISABLE_POSIX_TIMERS
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-19 11:39:22 -03:00
chao an
0f0a94186f arch/arm/toolchain: migrate the toolchain define to arch/arm/Kconfig
migrate the toolchain define to arch/arm/Kconfig to simplify new toolchain registration

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-16 14:47:27 +08:00
raiden00pl
9770555102 nucleo-g070rb/nsh: refresh config 2022-08-03 23:43:19 +08:00
raiden00pl
0e97e57d23 stm32g071b-disco: gpio dev support 2022-07-23 16:48:13 -03:00
raiden00pl
0253f0ff66 stm32g071b-disco: ina230 support 2022-07-23 16:48:13 -03:00
Xiang Xiao
f9e3ef3464 Revert "libc/stdio: enable long long formating by CONFIG_HAVE_LONG_LONG"
This reverts commit b1c72c023c.
2022-07-20 18:06:29 +03:00
raiden00pl
c9ec91a5b5 stm32g071b-disco: add OLED support 2022-07-18 14:14:51 +03:00
raiden00pl
9276e41321 b-l072z-lrwan1: use board common logic for ssd1306 2022-07-15 10:22:58 -03:00
raiden00pl
072b2bca45 boards/stm32f0l0g0: add ssd1306 to board common logic 2022-07-15 10:22:58 -03:00
raiden00pl
703e5e4226 boards/stm32f0l0g0: common board logic support 2022-07-15 10:22:58 -03:00
Xiang Xiao
b1c72c023c libc/stdio: enable long long formating by CONFIG_HAVE_LONG_LONG
and remove CONFIG_LIBC_LONG_LONG option to simplify the usage.
note: the size will increase 668
before change:
   text    data     bss     dec     hex filename
 168440     348    4480  173268   2a4d4 nuttx

after change:
   text    data     bss     dec     hex filename
 169108     348    4480  173936   2a770 nuttx

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-13 09:50:38 -03:00
raiden00pl
2192b8df2b boards: add initial support for stm32g071b-disco board 2022-07-10 21:02:23 -03:00
raiden00pl
b3e11b605a boards: add initial support for stm32l0538-disco 2022-07-09 23:37:33 +08:00
Xiang Xiao
1f920e55d3 Move warning option from Make.defs to Toolchain.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-15 15:40:35 +03:00
Xiang Xiao
a3c9b413d8 arch/arm: Remove FAR and CODE from board folder(2)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-03 16:50:52 +03:00
Xiang Xiao
aeb9c5d822 boards: Move -fno-strict-aliasing from Make.defs to Toolchain.defs
and migrate MAXOPTIMIZATION into ARCHOPTIMIZATION

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-01 11:36:41 +03:00
Xiang Xiao
8f8ee25a9c boards: Move -g from Make.defs to Toolchain.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-25 16:23:03 +03:00