Commit Graph

34622 Commits (d0dba1a533eb97d8fbb70b36acdaf5ca20f117cc)

Author SHA1 Message Date
Jamie Smith 1b60ddad31
LPC1768: Fix SPI 16-bit transfers (#277)
* LPC1768: Fix I2C pins not being open drain, fix destroying and recreating I2C making transactions fail

* bus -> peripheral

* LPC1768: Support static pinmaps

* Update ARCH_PRO pin names header to pass muster

* LPC1768: Fix SPI 16-bit transfers

* Fix merge mistake
2024-05-07 01:00:10 -07:00
Jamie Smith 94a7fbca0b
LPC1768: Support static pinmaps (#276)
* LPC1768: Fix I2C pins not being open drain, fix destroying and recreating I2C making transactions fail

* bus -> peripheral

* LPC1768: Support static pinmaps

* Update ARCH_PRO pin names header to pass muster
2024-05-07 00:25:22 -07:00
Jamie Smith 6ae571d0f0
LPC1768: Fix I2C pins not being open drain, fix destroying and recreating I2C making transactions fail (#275)
* LPC1768: Fix I2C pins not being open drain, fix destroying and recreating I2C making transactions fail

* bus -> peripheral
2024-05-07 00:13:20 -07:00
Jamie Smith a40e8198d0
Fix PWM API for reading period and pulsewidth on LPC1768 (#274)
* Fix PWM API for reading microseconds on LPC1768

* Fix semihosting related compile errors, fix pwm deinit

* Fix some mistakes, fix PWM frequency adjustment

* Fix a few more issues
2024-05-03 00:40:48 -07:00
Wang Xu cd37bf47d5
Adding NUCLEO-U545RE-Q and NUCLEO-U5A5ZJ-Q support, with some changes to stm_dma_utils (#273)
* added an option "QSPI_OSPIM_IOPORT_HIGH=1" to allow using the high IO ports (IO 4~7) of an OSPI peripheral to drive a QSPI device
updated STM32U5 firmware package to support STM32U5F/G devices
STM DMA Utils: added stm_get_dma_instance, stm_set_dma_link, stm_get_dma_link for working with DMA code in external libraries

* added NUCLEO-U545RE-Q and NUCLEO-U5A5ZJ-Q
USB is not supported yet

* added missing USART6 handlers for STM32U5

* changed PA_2_ALT0/PA_3_ALT0 in UART pinmap back to PA_2/PA_3 for NUCLEO-U545RE-Q

* renamed stm_get_dma_link to stm_get_dma_handle_for_link
renamed stm_set_dma_link to stm_set_dma_handle_for_link
added option "qspi_ospim_ioport_high" for MCU_STM32U5
implemented SetSysClock_PLL_HSI for NUCLEO-U545RE-Q and NUCLEO-U5A5ZJ-Q
made PLL_HSI the default clock source for NUCLEO-U545RE-Q and NUCLEO-U5A5ZJ-Q

* changed clock sources of NUCLEO-U545RE-Q and NUCLEO-U5A5ZJ-Q back to PLL+MSI
embedded LICENSE file into every source file in the STM32U5 firmware package
2024-05-03 00:39:59 -07:00
Jamie Smith e8b6238672
Some fixes for Teensy4 (#272)
* Fix teensy4 build

* Try and fix SCLK clock period issue for MIMXRT, add additional SPI pinmappings

* Add full UART pinmapping

* Make more robust to calling spi_format() after spi_frequency()

* Fix style

---------

Co-authored-by: Jamie Smith <jsmith@relativityspace.com>
2024-04-27 10:10:28 -07:00
Jamie Smith 04db467b3a
Reactivate block device tests (#270)
* Reactivate block device tests

* Oops missed some CMake files
2024-04-25 00:43:08 -07:00
Jamie Smith 3fcfbbdb57
Fix some issues with building on K64F, add K64F upload methods (#267)
* Fix some issues with building on K64F, add K64F upload methods

* Add Mbed upload method

* Fix pin validate test

* Also install json5

* Fix incorrect COMPONENT_SD config
2024-04-16 19:44:02 -07:00
Jamie Smith acfd341a16
Updates to targets JSON and related stuff for the website generator (#265)
* Various updates to support targets & drivers site generation

* Add regression test for python code, add links to README

* Don't need to duplicate device_name

* Fix typo and some extra commas

* Rephrase docs
2024-04-09 18:37:39 -07:00
Jamie Smith fbaec0c739
Fix STM32H7 LPUART clock source being incorrect for higher baudrates (#263)
* Fix STM32H7 LPUART clock source incorrect for higher baudrates

* Add comment
2024-04-04 21:04:24 -07:00
Jamie Smith 8926deb711
Fix clocking configuration issues on STM32H7x processors (#262)
* Fix NUCLEO_H743ZI clock config not enabling overdrive mode

* Update most STM32H7 devices to new clocking configuration

* Fix ADC clock for old chip revs

* Fix CAN clock, finish clocking for 280MHz devices

* Fix a few typos and such

* A few more targets.json tweaks

* Fix comma
2024-03-28 09:36:36 -07:00
Jamie Smith 862f46233c
Use a virtual environment for Python packages by default (#261)
* Use a virtual environment for Python packages by default

* Install python3-venv in CI

* Don't use sudo

* Oops missed a "STATUS"

* Fix second build dir not using venv
2024-03-14 10:13:23 -07:00
JojoS b2193029c2
use mbed-target-config.h from generated header (#257) 2024-03-05 09:12:23 -08:00
Jamie Smith 2deef5a681
Bugfix: Only link mbed-wifi if it exists for this target (#252) 2024-02-20 20:56:10 -08:00
Jamie Smith e6a63d9623
Document remaining features and components (#249) 2024-02-18 12:20:55 -08:00
JohnK1987 1c2974bbd3
Add feature for auto search of upload method config for custom targets (#250)
* Update app.cmake

Add possibility to use upload config also for custom targes

* Update app.cmake
2024-02-15 22:47:22 -08:00
Jamie Smith 7501ee7fc9
Document and clean up wifi and LoRa modules, add ability in Python to get non-public targets (#247)
* Add a way to get target attributes for non public targets

* Document all WiFi and LoRa modules

* Fix some errors

* Fix another CMake error
2024-02-11 14:19:17 -08:00
Jamie Smith f19273aa7a
Begin documenting Mbed OS target features and components (#240)
* Start on documenting features and components

* Missed some renames

* Go through all cellular and 802.15.4 modules

* Fix build

* Fix style

* Update copyright year
2024-02-08 22:46:20 -08:00
JohnK1987 d1b0ccaa8b
Update FindSTLINKTools.cmake for STM32CubeCLT (#228)
* Update FindSTLINKTools.cmake for STM32CubeCLT

STM32CubeCLT

* correction

* line 7 reverted

* Lines 28-29 rewritten to lowercase letters

* Update for Linux

* Change file name for Windows

* revert back components names

* change file name also for Linux
2024-02-07 20:52:49 -08:00
Jamie Smith 031d274c62
Fix some upload and test issues, especially for LPC1768 (#231)
* Fix USB instructions for Ubuntu, fix greentea compile failure for devices without TRNG

* Don't compile device key without COMPONENT_FLASHIAP

* Fix some upload issues for LPC1768

* Oops don't commit cmake variants

* Don't build connectivity-netsocket-tls without TRNG support
2024-01-30 09:41:32 -08:00
Sam Lefebvre 033058a085
Add target hse u575xg (#218)
* Definition added for hse and msi pll

* Updating rom and ram size

* Adding target MCU_STM32U575xG
2024-01-21 01:06:28 +01:00
Jamie Smith f42c322425
[draft] Don't reset the RTC time from gettimeofday(), plus other RTC cleanups (#210)
* RTC related cleanups, including not resetting the RTC time from gettimeofday()

* Update readme about STM32 clocking

* Oops, fix git issue
2024-01-19 14:57:58 -08:00
JohnK1987 ca8b6cb609
Update STM32_gen_PeripheralPins.py (#217)
Protection against using python version older than python3+
2024-01-19 12:50:13 -08:00
Jamie Smith 7edab2d1ce
Add upload methods for NUCLEO_H723ZG (#209)
* Add upload methods for NUCLEO_H723ZG

* Oops fix comment

* Also fix another comment
2024-01-17 01:22:09 -08:00
Jamie Smith 85c5dab9da
Enable floating point printf by default (#208) 2024-01-16 08:34:34 -08:00
Jamie Smith 73b0306230
Increase RPi Pico PWM range and resolution to the max supported by HW (#203)
* Attempt to increase RPi Pico PWM range and resolution to the max supported

* Fix copyright for pwmout_api.c

* Fix ADC implementation so it works!  Fixes incorrect return type, adds +1 to top_count, fixes missing pwm_config_set_wrap() call.

* Revert printf change in this PR
2024-01-16 08:33:59 -08:00
Jamie Smith 699437ecf9
Allow Mbed CE to be built as an Arduino core (#206)
* Various changes for Arduino core support

* Apply Arduino Mbed TLS patches

* Apply linker script patch, add missing CXX standard

* Fix SDBlockDevice compile error, fix "no rule to make mbed-target-config.h"

* Fix missing source file for RPi Pico

* Fix missing licenses
2024-01-13 10:01:45 -08:00
Jamie Smith 8e38d02ced
Fix issues with new async SPI changes that broke compiling for B_U585I_IOT2A (#204)
* Fix issues with new async SPI changes that broke compiling for B_U585I_IOT2A

* Few more incorrect nullptrs

* Fix style
2024-01-11 12:23:03 -08:00
Jamie Smith c1effb15ec
Enable RPi Pico's optimized ROM floating point routines (#202)
* Enable RPi Pico's optimized ROM floating point routines

* Add license header
2024-01-06 00:16:01 -08:00
timIdeaTech 79c56f3155
add lfsv2 to storage/platform lib list (#201)
add lfsv2 to storage/kvstore/kv_config link libs
2023-12-20 16:42:04 -08:00
Jamie Smith 69d95b598a
Make DMA SPI driver aware of CPU cache, fix data corruption and other SPI issues on STM32H7 (#199)
* Handle cache alignment in DMA SPI driver

* Fix build on cache-less devices

* Fix a couple things I missed

* Run formatter, improve CacheAlignedBuffer docs

* Add missing license identifiers to source files

* Make CacheAlignedBuffer heap-allocatable, try and add exclusion for Nordic license in scancode_evaluate.py

* Formatting, docs, revert accidental change

* Update code blocks to pass spell checker
2023-12-19 10:21:47 -08:00
Jamie Smith d9676cccca
Fix STM32 I2C v2 async transfer not doing a repeated start (#197)
* Fix STM32 I2C v2 async transfer not doing a repeated start

* Clarify docs
2023-11-21 20:38:36 -08:00
Jamie Smith 28815b13d3
DMA SPI support for STM32 devices (#162)
* Start on STM32 DMA SPI

* Update all objects.hs, add interrupt function

* Initial DMA code should be ready to test out...

* Fix SPI interrupt-mode IRQ handlers, add SPI::transfer_and_wait

* Fix CMake error when building for STM32WL processors

* Now builds on all STM devices!

* Properly support STM32U5 / DMA IP v3

* Start on STM32F4 support, fix hardfault on IP v1 and v3 due to incorrect indexing

* Fix Rx-only transfers, add abort code, fix incorrect channel assignments for DMA IP v1 devices

* Start on STM32H7 SPI DMA

* Fixes for H7: Correctly manage data cache, keep SPI ISR enabled

* Implement DMA SPI header constants for all remaining STM32 families.  Also add support for freeing DMA channels

* Try and fix build on STM32G0

* Fix build on STM32G0

* Add SPI_32BIT_WORDS label, start on fixing SPI docs

* SPI: Implement reference counting so that DMA channels get freed properly

* Fix issue where SPI data could get corrupted (by TI mode turning on) depending on memory layout (if your spis pointer & 0x10 was nonzero)

* Mark DMA channels as unallocated when SPI bus is freed

* Simplify spi_abort_asynch()

* Fix some rebase issues, fix failing to allocate DMA channel on STM32U5

* Fix DMA getting stuck on STM32F4, F7, and F2
2023-11-02 20:16:45 -07:00
Jamie Smith 7e9d658ae9
Allow Mbed config files to be json5 in addition to json (#194)
* Allow Mbed config files to be json5 in addition to json

* Also handle custom_targets.json

* Add missing "install python packages" step
2023-10-26 09:48:33 -07:00
Jamie Smith 7c61babb10
Fix incorrect requirements line for dotenv (#193)
* Fix incorrect requirements line for dotenv

* Also use requirements.txt in CI jobs
2023-10-10 13:00:03 -07:00
Jamie Smith 3af1c75ca8
Bring python packages into the mbed-os source (#192)
* Initial import of python packages

* Move tests to subfolder, use tests in generate_configuration.cmake

* Bring python packages into the source tree instead of needing to be installed separately

* Use python3

* Just use distro default python

* Install all the requirements with apt-get

* unittests is part of Python now

* Add appdirs, set python version

* Add some missing dependencies

* Add more packages

* Add requirements.apt.txt files, fix relative paths with scancode_evaluate.py

* Fix return code handling for license scan errors

* ok let's try that again, also improve error output from scancode evaluate

* Add missing license headers
2023-10-10 09:54:53 -07:00
Jamie Smith e1a1542310
Reactivate tests under drivers/ and fix deprecation warnings (#191)
* Reactivate tests under drivers/ and fix deprecation warnings

* Fix missing statement

* Oops, fix commented tests
2023-10-03 21:21:16 -07:00
Jamie Smith eee0647897
Reactivate some Network & Netsocket tests, Mbed TLS tests, Device Key test. Also fix lots of deprecation warnings (#189)
* Reactivate some Network & Netsocket tests, Mbed TLS tests, Device Key test.  Also fix lots of deprecation warnings

* Style fix tcpsocket_endpoint_close.cpp

* Style fix ../lp_ticker/main.cpp

* Style fix ../lp_ticker/main.cpp

* Handle tests which require an RTOS

---------

Co-authored-by: JohnK1987 <Odiin@seznam.cz>
2023-10-01 15:23:59 -07:00
Jamie Smith 9f4987d1cb
Refactor flash setup for MIMXRT105x devices, add flash API support for MIMXRT1062 EVK (#187)
* Refactor flash setup for MIMXRT105x devices, adds flash support for MIMXRT1062 EVK

* Remove commented code

* Use BOARD_FLASH_SIZE in boot headers

* Fix setting which should be disabled in run mode
2023-10-01 09:25:26 -07:00
Jamie Smith 05a57dc62c
Replace REDLINK upload method with LINKSERVER (#186)
* Replace REDLINK upload method with LINKSERVER

* Fix sleep test failure on MIMXRT, fix failure to debug

* Remove no longer needed XML files
2023-09-26 23:28:35 -07:00
Jamie Smith 86723f7dab
Synchronize changes with Mbed upstream: September 2023 edition (#185)
* Fix null pointer dereferencing

Add null check for return values of functions that are mostly (but not
always) checked for null.
E.g., since 98% of calls to protocol_stack_interface_info_get_by_id
check for null, it is likely that the function can return null values in
some cases, and omitting the check could crash the program.

* Update MAX32660 peripheral drivers with final ones that use by SDK

* Apply MAX32660 delta
Update mbed hal function as per of SDK update

Signed-off-by: Sadik.Ozer <sadik.ozer@analog.com>

* M2354: Fix debug failure in Mbed Studio

In Mbed Studio, debugging, based on pyOCD, requires Mbed OS application code starting on the sector boundary.

Modification list:
1.  Update TF-M import assets with MCUboot header padding to sector aligned
2.  Following above, change header size argument (-H) in wrapper.py command line
3.  Following below, fix min-write-size (--align) to 4 (per flash_area_align()) in wrapper.py command line
    https://docs.mcuboot.com/design.html#image-trailer

Related issue:
https://github.com/ARMmbed/mbed-os/issues/15417

* Do not clear interrupt flag during initialization
This causes issue for repeaded initialization while using BufferedSerial mode

Signed-off-by: Sadik.Ozer <sadik.ozer@analog.com>

* MAX32660, MAX32670 UART performance improvement

Signed-off-by: Sadik.Ozer <sadik.ozer@analog.com>

* Handle negative values passed to close()

Calling close() with negative numbers causes out-of-bounds indexing of the filehandles array. For example, this can happen if open() returns an error and the value is later passed to close().

* Moved a { to the same line as if

Moved a { to the same line as if

* add nullpointer check in LWIP::socket_close

* Fix crash when using FDCAN3 RX IRQ on STM32G473 (and others)

* connectivity: drivers: Update Nuvoton M467 EMAC DMA_IE ctl

In IRQ Handler, to disable some interrupt type of DMA error.
It could avoid unexpected repeated interrupt.The masked bit of
DMA_IE could be recovered in next EMAC IRQ event.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>

* Add workaround for G474 hardfault

* update drivers STM32WL CUBE V1.3.0

* Changed static to weak

* Fix: Do not disable SPI for manual drive mode during transaction setup
It has been reported that disabling SPI module causes glitch for manual SS drive mode

Signed-off-by: Sadik.Ozer <sadik.ozer@analog.com>

* make cellular event queue size configurable

update unit tests

---------

Signed-off-by: Sadik.Ozer <sadik.ozer@analog.com>
Signed-off-by: cyliang tw <cyliang@nuvoton.com>
Co-authored-by: Mingjie Shen <shen497@purdue.edu>
Co-authored-by: Ahmet Polat <Ahmet.Polat@maximintegrated.com>
Co-authored-by: Sadik.Ozer <sadik.ozer@analog.com>
Co-authored-by: Chun-Chieh Li <ccli8@nuvoton.com>
Co-authored-by: alrvid <126816223+alrvid@users.noreply.github.com>
Co-authored-by: Jost, Chris <79271064+chrJost@users.noreply.github.com>
Co-authored-by: Joseph Duchesne <joseph@avidbots.com>
Co-authored-by: cyliang tw <cyliang@nuvoton.com>
Co-authored-by: Maxim Markin <mak22223@ya.ru>
Co-authored-by: Charles <hallard04@free.fr>
Co-authored-by: Lukas Karel <lukas.karel@world-direct.at>
2023-09-24 23:37:28 -07:00
Jamie Smith 162acab842
STM32U5 HAL update, NUCLEO_U575ZI upload method file (#184)
* STM32U5: STM32Cube_FW_U5_V1.2.0

* Update STM32U5 upload method config files

* Fix HAL sleep manager test bug causing test failure on STM32U5

---------

Co-authored-by: Jerome Coutant <jerome.coutant@st.com>
2023-09-24 09:54:31 -07:00
Jamie Smith 36506c9d61
Fix warnings from kill and getpid not being implemented (#183)
* Fix warnings from kill and getpid not being implemented

* Fix comments
2023-09-20 21:52:30 -07:00
Jamie Smith 264dbe219f
SDBlockDevice: revert HW CS support, add async support (#181)
* SDBlockDevice: revert HW CS support, add async support

* Convert one last call

* Turn off debug mode, whoops

* Run formatter
2023-08-27 11:05:18 -07:00
Jamie Smith 1ed5f1f149
SPI Driver API bugfixes and cleanup, part 2 (#180)
* Make it so that SPI::select() works correctly with async stuff

* Add more overloads for SPI functions, make sure that SPI::abort_transfer() correctly toggles CS

* SPI: Implement reference counting so that DMA channels get freed properly

* Fix initialization of SPI peripheral structures

* Update docs a bit

* Use a mutex to protect SPI::_peripherals instead of a critical section, because spi_free() may not be ISR safe

* Style fixes
2023-08-25 09:14:00 -07:00
Jamie Smith 20756f3bd7
Upversion RPi Pico SDK (#176)
* Remove old pico SDK, import latest version using new importer script

* Add new importer script, update CMakeLists

* Merge changes from newer SDK into  init assembly and linker script

* Update pico hal code for new SDK version

* Clean up linker script a bit, revert ram size

* Fix accidental breakage of watchdog-reset test from warning fixing!  Also better document USB setup procedure and disable reset as part of the test runner.
2023-08-07 00:22:03 -07:00
JohnK1987 eb231be2cd
Add HAL for STM32H5 family into MbedCE (#172)
* Add HALs to MbedCE

* HALs for i3c like an option

* Update stm32h5xx.h because of UTF-8 check
2023-07-23 23:21:45 -07:00
timIdeaTech 34d31bd033
Bug fix/lorawan sx127x get status type (#173)
* Update LoRaRadio.h - radio_settings.state type

* Update SX1272_LoRaRadio.cpp - fix get_status() return type

* Update SX1276_LoRaRadio.cpp - fix get_status() return type
2023-07-23 13:55:41 -07:00
Jamie Smith 946a1b57cb
Fix LoRaWan compile error, add DISCO_L072CZ_LRWAN1 upload method configuration (#170) 2023-07-20 09:24:05 -07:00
JojoS 5b25b173c8
fix argument number for custom linker script (#169) 2023-07-17 19:54:05 -07:00