Commit Graph

34622 Commits (d0dba1a533eb97d8fbb70b36acdaf5ca20f117cc)

Author SHA1 Message Date
Jamie Smith d0dba1a533
Refactor and combine STM32H7 linker scripts (#356)
* Refactor STM32H7 linker scripts

* Fix tabs
2024-09-24 21:17:54 -07:00
ccli8 ab8e3d4420
M467: Fix invoking GPIO_SET_DEBOUNCE_TIME (#357)
Fix missing gpio_base on invoking GPIO_SET_DEBOUNCE_TIME()
2024-09-23 20:51:18 -07:00
Jamie Smith 0a7652033c
Allow memap.py to process memory bank information (#345)
* Begin modernizing memap, add parsing of start address and symbol names

* Memap can now process and print memory bank info!

* Rename symbols back to modules, it was correct before

* Remove trailing whitespace

* Add type hints to modernized functions

* Apply suggestions from code review

Co-authored-by: VictorWTang <33789988+VictorWTang@users.noreply.github.com>

* Remove else

Co-authored-by: VictorWTang <33789988+VictorWTang@users.noreply.github.com>

* Clarify statement

---------

Co-authored-by: Victor Tang <me@victorwtang.dev>
Co-authored-by: VictorWTang <33789988+VictorWTang@users.noreply.github.com>
2024-09-23 20:50:05 -07:00
ccli8 037fe9b619
NUVOTON: Fix for target.boot-stack-size config in linker script (#351)
"target.boot-stack-size" can expand to MBED_CONF_TARGET_BOOT_STACK_SIZE
or legacy MBED_BOOT_STACK_SIZE. Though MBED_BOOT_STACK_SIZE is unsupported
in Mbed CE, make its preprocess consistent in linker scripts by prioritizing
MBED_CONF_TARGET_BOOT_STACK_SIZE, then MBED_BOOT_STACK_SIZE for being
compatible.
2024-09-22 19:22:33 -07:00
Jamie Smith cfee81c7ce
Update STM32H7 HAL driver to v1.11.3 (#353)
* Update STM32H5 HAL driver, fix some DMA bugs

* Disable LL driver

* Add scancode ignore rules

* Update STM32H7 HAL driver to v1.11.3

* Fix some license issues
2024-09-21 23:13:52 -07:00
Jamie Smith f2a128b895
Update STM32H5 HAL driver, fix some DMA bugs (#344)
* Update STM32H5 HAL driver, fix some DMA bugs

* Disable LL driver

* Add scancode ignore rules
2024-09-21 23:13:39 -07:00
Jamie Smith 2bc173e3f7
Remove RDA emac code as the target it is for no longer exists (#354) 2024-09-21 22:59:52 -07:00
ccli8 79c9095535
Upload: Fix GDB restart command for pyOCD (#350)
PyOCD debug restart can be failed without this somehow. It appears the device
under debug must be halted after MBED_UPLOAD_RESTART_COMMANDS, but this is
broken. Change to "monitor reset halt" to fix it.
2024-09-20 19:45:53 -07:00
ccli8 ac57d4cb97
mbedtls: M467: Fix H/W acceleration build (#348)
This fixes mbedtls M467 H/W acceleration build on migration to
Mbed CE.
2024-09-19 09:06:24 -07:00
Guilherme Ricioli eca8047244
Add support for hostname request in lwIP interface (#347)
* Add methods for setting hostname

In the same way it is done for setting MAC address, add methods for
setting hostname. The underlying network stack can then request this
to the local DNS through DHCP.

* Request hostname through DHCP

If hostname is provided, request it to local DNS through DHCP.
2024-09-18 18:34:25 -07:00
Jamie Smith ef8181a129
STM32H7: Fix wrong address for DTCM in linker script (#346)
* STM32H7: Fix wrong address for DTCM in linker script

* Fix tab
2024-09-17 08:37:26 -07:00
ccli8 a49d8f2470
Fix linker script incorrectly selected for bare-metal profile (#342)
mbed-os and mbed-baremetal library targets both are created, so we cannot
use if(TARGET mbed-os) or if(TARGET mbed-baremetal) to determine which one
the application target links to. Instead, determine by checking application
target's LINK_LIBRARIES property.
2024-09-12 23:48:05 -07:00
Jamie Smith 40e3056f3d
Unify MAX32625 targets (#327) 2024-09-12 21:02:51 -07:00
Jamie Smith 232d767225
Supply memory bank information from the configuration script (#326)
* New version of memory bank information system

* Start upconverting linker scripts and target definitions

* Augh my script was being gitignored

* Add tests, update Cypress and STM32 linker scripts and target definitions

* Fix some CI issues

* Fix warning spam on LPC1768

* Fix STM32H745 family compile failure due to failure to include cmsis_nvic.h

* Respond to easy comments

* Break up function into pieces

* Improve type hints, don't write out a JSON file as a side effect

* Two more comments
2024-09-12 20:35:03 -07:00
ccli8 b352953f86
Upload: Support Nuvoton targets (#334)
* NUVOTON: Support upload methods

Support targets include:
- NUMAKER_PFM_NANO130
- NUMAKER_PFM_NUC472
- NUMAKER_PFM_M453
- NUMAKER_PFM_M487
- NUMAKER_IOT_M487
- NUMAKER_IOT_M467
- NUMAKER_IOT_M252
- NUMAKER_IOT_M263A
- NU_M2354

* NUVOTON: Add openocd upload method document

This adds document to enable openocd upload method for Nuvoton
NuMicro Cortex-M series.
2024-09-09 00:26:08 -07:00
Jamie Smith 428b56ecdd
Allow upload method configs to specify an OpenOCD version range (#340) 2024-09-08 21:48:30 -07:00
JohnK1987 fa86c2b73c
Add support of SPI API for STM32H5 family (#324)
* fix PWM pin map in context of Timer change

* Note about DAC on Nucleo-H503RB

* Add ADC and DAC for STM32H5

* Copyright fix

* Add I2C for STM32H5

* fix I2C related code

* ADC/DAC fix

* Enable I2C API

* Copyright fix

* Add SPI for STM32H5

* Modification of stm spi API for h5 family

* fix I2C device

* fix I2C ASYNCH macro

* fix revert back the stop variable position

* Fix clock for SPI

* fix some details

* Rename startup_stm32h563xx.s to startup_stm32h563xx.S

* Rename startup_stm32h503xx.s to startup_stm32h503xx.S

---------

Co-authored-by: Jan Kamidra <odiin@windowslive.com>
2024-09-08 12:58:45 -07:00
Jamie Smith d1dbb405c8
Fixes for SPI slave implementation (#336)
* Start on SPI slave comms test

* Free pins in SPI and SPISlave destructor

* Improve LPC1768 readable()
2024-09-03 19:34:13 -07:00
Jamie Smith e6043218fd
Fix NUCLEO_L452RE_P arduino pins (#335) 2024-09-02 14:52:58 -07:00
Jamie Smith 975e6b2fa5
Fix some DMA SPI issues with DMA IP v3 and/or word size > 8 bits (#332)
* Fix some DMA SPI issues with DMA IP v3 and/or word size > 8 bits

* Fix typo

* oops fix naming
2024-08-29 01:22:44 -07:00
ccli8 de273eec73
Upload: Honor OUTPUT_EXT for flash (#331)
Change signature from:
function(gen_upload_target TARGET_NAME BIN_FILE HEX_FILE)
To:
function(gen_upload_target TARGET_NAME BINARY_FILE)

If OUTPUT_EXT is undefined or defined to "bin", BINARY_FILE is .bin file,
otherwise .hex file.

The update applies to all UploadMethodXxx files.
2024-08-25 23:46:15 -07:00
ccli8 778ecaf95b
Upload: OpenOCD: Honor OUTPUT_EXT for flash (#330)
In OpenOCD flash, if OUTPUT_EXT is defined in targets.json5, use image
file with this extension <target>.<OUTPUT_EXT> for flash, or default
to <target>.elf.
2024-08-22 23:42:09 -07:00
ccli8 88de6a1070
M2354: Fix compile error with TF-M integration (#325)
* M2354: Fix compile error with TF-M

In CMake, mbed-psa moves out of mbed-core, its library type changing to
STATIC from INTERFACE. Following this modification, the platform TF-M
code relying on mbed-psa needs to explicitly specify the dependency
through target_link_libraries().

* M2354: Enable OUTPUT_EXT set to either bin or hex

Update post-build script to enable OUTPUT_EXT can be set to "bin" or
"hex" in targets.json5.

* NUVOTON: Locate correct python3 command path across platforms

shutil.which("python3") can locate incorrect path when there are multiple
python3 installations. Instead, follow the link below, use sys.executable.
https://docs.python.org/3/library/sys.html#sys.executable
2024-08-22 19:40:30 -07:00
ccli8 c3802999db
Upload: Mbed: Honor OUTPUT_EXT for flash (#328)
In Mbed flash, if OUTPUT_EXT is defined in targets.json5, use image
file with this extension <target>.<OUTPUT_EXT> for flash, or default
to <target>.bin.
2024-08-22 09:53:21 -07:00
JohnK1987 3f239c6201
Add support of I2C API for STM32H5 family (#323)
* fix PWM pin map in context of Timer change

* Note about DAC on Nucleo-H503RB

* Add ADC and DAC for STM32H5

* Copyright fix

* Add I2C for STM32H5

* fix I2C related code

* ADC/DAC fix

* Enable I2C API

* Copyright fix

* fix I2C device

* fix I2C ASYNCH macro

* fix revert back the stop variable position

---------

Co-authored-by: Jan Kamidra <odiin@windowslive.com>
2024-08-19 00:29:35 -07:00
ccli8 047bbc3bd3
M467: Replace PlatformMutex with rtos::Mutex (#322)
PlatformMutex becomes unsupported. rtos::Mutex now replaces it,
supporting both mbed-baremetal and mbed-os.
2024-08-16 06:23:32 +02:00
JohnK1987 8d2ede6498
Add AnalogIn and AnalogOut APIs support for STM32H5 (#314)
* fix PWM pin map in context of Timer change

* Note about DAC on Nucleo-H503RB

* Add ADC and DAC for STM32H5

* Copyright fix

* ADC/DAC fix

---------

Co-authored-by: Jan Kamidra <odiin@windowslive.com>
2024-08-11 22:21:53 -07:00
Jamie Smith c1e3c86a4d
A few minor H5 fixes (#318) 2024-08-04 23:12:53 -07:00
Jamie Smith 42df56c391
Make network tests properly support boards with wifi again (#317)
* Make network tests properly support boards with wifi again

* Style fixes

* Style fix again
2024-08-03 00:25:00 -07:00
Jamie Smith 5354079bfb
Lots of K64F SPI fixes (#315)
* Update DSPI driver to latest version from NXP

* Other updates to SDK files

* Fix double DMA transactions, improve dummy byte support

* Simplify dummy byte setting

* Also fix SPI driver bug

* Fix infinite hang with interrupt SPI

* Better fix for SPI hang

* Remove earlier fix
2024-07-28 13:32:42 -07:00
Jamie Smith de0c404983
Synchronize changes with Mbed upstream: July 2024 edition (#309)
* remove stdio checks in serial init if no console is available

* STM32WL fix set preamble length to 8

* Add target support for XDOT_MAX32670

* TARGET_STM: only mask CAN rx interrupt after rx interrupt, not all CAN interrupts

* Sleep Radio in between DC scheduled

* Nuvoton HUSBD support endpoint write ZLP

* USBCDC: support ZLP

* Don't overlap STM32 FDCAN RAM sections

* allow to override antenna gain

* TFM: Fix undeclared function tfm_ns_interface_init

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: CAN: Fix filter mask

NOTE: This fix only targets CAN (M453/M487), not CAN-FD (M467).
NOTE: NUC472 CAN doesn't support filter.

* NUVOTON: CAN: Fix Rx interrupt doesn't work

Major modifications:
1. Handle Rx interrupt based on Message Object interrupt (CAN_IIDR=0x0001~0x0020) instead of CAN_STATUS.RxOK
2. Also handle Tx interrupt following above for consistency

Other related modifications:
1. Fix signature type error in CAN_CLR_INT_PENDING_BIT()
2. Add CAN_CLR_INT_PENDING_ONLY_BIT() which doesn't clear NewDat flag so that user can fetch received message in thread context

NOTE: This fix only targets CAN (NUC472/M453/M487), not CAN-FD (M467).

* NUVOTON: CAN: Fix Message Object number for Tx and recognition of Rx interrupt

1.  The same Message Object number cannot use for both Tx and Rx simultaneously.
    For Tx, Message Object number 31 is reserved instead of 0.
    For Rx, Message Object numbers 0~30 are used and for filters.
2.  NewDat bit (CAN_IsNewDataReceived()) isn't exclusive to Rx.
    Recognize Rx interrupt by Message Object number other than 31.

NOTE: This fix only targets CAN (NUC472/M453/M487), not CAN-FD (M467).

* NUVOTON: CAN: Fix filter mask being zero

On mask being zero, it means any match, not exact match.

NOTE: This fix only targets CAN (M453/M487), not CAN-FD (M467).
NOTE: NUC472 CAN doesn't support filter.

* Allow custom TCXO control parameter

Allow custom TCXO control parameter

* NUVOTON: EMAC: Fix undeclared function mbed_error_printf

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: AnalogIn: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: CAN: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: AnalogOut: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: SPI: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: I2C: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* NUVOTON: Serial: Fix undeclared function gpio_set

ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

* Add separate flags for I2C slave transfer in progress

Fixes ARMmbed/mbed-os#15498

Adds 2 boolean flags to the STM32 `i2c_s` object
to indicate whether a transfer is in progress,
separate from the existing "transfer pending" flags.

`i2c_slave_write`, `i2c_slave_read` and their associated callbacks
are modified to use these flags in addition to the pending flags.
The original behavior of the pending flags is preserved.

* ESP8266: Fix accessing uninitialized variable

* Added missing delete

* Add ability to change number of status registers for macronix QSPIF devices

* correct scan parameters types

* skip CRC when initializing TDBStore

Problem: The build_ram_table() function of TDBStore loops over every entry, calculates the checksum and compares them to the stored checksum in the entry header to ensure integrity. For larger TDBStores (e.g. 8 MiB or more) in external single-SPI flash devices this check can take very long, thus rendering it unusable in some cases.

Solution: The suggested solution skips the time consuming CRC of the data. After reading the key and calculating its CRC, it sets next_offset to the beginning of the next entry, thereby skipping the data. While this skips the integrity check, it significantly reduces the initial building of the RAM table.

The data CRC can be enabled or disabled with a compiler flag.

Contribution is provided on behalf of BIOTRONIK.

* Added missing check for replay protection pointer before allocating new variable

Problem: If a key with write-once flag is being set in a SecureStore without rollback-protection store (i.e. _rbp_kv == NULL), additional memory will be allocated for the variable _ih->key. The memory will not be deleted, though, as the delete in line 434 only happens if a rollback-protection store exists (i.e. _rbp_kv != NULL)

Solution: Only allocate the memory if _rbp_kv != NULL

Contribution is provided on behalf of BIOTRONIK.

* Increase AT timeout to 10s in AT_CellularSMS::send_sms

For some devices sending can be slow (as an example see SIM800, it can be up to 60s), command is being run properly but default timeout is returning an invalid error.
See https://www.elecrow.com/wiki/images/2/20/SIM800_Series_AT_Command_Manual_V1.09.pdf

* Increase AT timeout to 10s in AT_CellularSMS::get_sms

When SMS list is big and baudrate is not fast enough, with default timeout we can suffer from timeout error while getting a sms because method is parsing the full list and this takes long.

* Fix AT_CellularSMS::list_messages breaking in text mode when CRLF is contained in SMS payload text

When parsing SMS, it can happen that we receive CRLF in the SMS payload (happened to me when receiving provider texts).
As an example, we can receive:

"""
Hello <CR><LF>
World!
"""

With previous implementation, second consume_to_stop_tag was stopping in <CR><LF> and rest of the code was failing for obvious reasons.
With this commit we consume the full payload as bytes.

* Add missing SPDX identifier to a bajillion Nuvoton source files + some others

* More license fixes, upgrade M451 legacy PinNames.h, add MCU description

* Fix some more legacy pin names

---------

Co-authored-by: Jost, Chris <79271064+chrJost@users.noreply.github.com>
Co-authored-by: Charles <hallard04@free.fr>
Co-authored-by: Leon Lindenfelser <llindenfelser@multitech.com>
Co-authored-by: Pavel Sorejs <sorejs@gmail.com>
Co-authored-by: cyliang tw <cyliang@nuvoton.com>
Co-authored-by: jmcloud <jmcloud@tesla.com>
Co-authored-by: Chun-Chieh Li <ccli8@nuvoton.com>
Co-authored-by: Adam Gausmann <adamg@esdemc.com>
Co-authored-by: Mingjie Shen <shen497@purdue.edu>
Co-authored-by: Matthias Goebel <matthias.goebel@biotronik.com>
Co-authored-by: danielzhang <danielzhang@mxic.com.cn>
Co-authored-by: Mathieu Camélique <mathieu.camelique@edu.hefr.ch>
Co-authored-by: David Alonso de la Torre <davidalto97@gmail.com>
2024-07-21 00:16:51 -07:00
JohnK1987 6b946d4c4f
Add PwmOut API support for STM32H5 (#299)
* Enable PwmOut API

* remove pins with LpTimer

* Prepare for H563

* Change source of us ticker from TIM2 to TIM3

---------

Co-authored-by: Jan Kamidra <odiin@windowslive.com>
2024-07-20 09:10:44 -07:00
Jamie Smith 5a118826a8
Fix CellularInterface functions never being defined (#307)
* Fix several link errors with mbed-cellular

* Fix unittest failure

* Try again to fix unit tests?

* OK try and fix these a little better

* Fix style
2024-07-19 01:36:19 -07:00
JohnK1987 eb0012983a
Add basic source files for MCU H503xB+H563xI + configuration for Nucleo H503RB+H563ZI (#294)
* add targets H503xB and H563xI

* add STM32H5 basic stettings and drivers

* Necessary modification in STM32 family drivers for STM32H5 family

* targets.json5 modified for STM32H503xB and STM32H563xI

* Prototype Upload methods for Nucleo boards of STM32H5 family

* fix typo

* typo fix

* Add images for H5 targets

* cmsis_mcu_desc fix

* targets.json fix

* merge all clock files to one

* Enable Mbed upload method

* fix mcu_family_target

* fix for clock settings

* move - device remove list to family level

* fix targets.json

---------

Co-authored-by: Jan Kamidra <odiin@windowslive.com>
2024-07-10 21:06:28 -07:00
Jamie Smith 71cb8129af
Fix deprecation issues with older Python code (#296)
* Fix deprecation issues with older Python code

* Remove mbed_greentea package
2024-07-06 01:19:25 -07:00
Jamie Smith 25dbf7c5fd
Refactor CYW43xxx wi-fi driver to better work with CMake and move code out of the Portenta target folder (#292)
* Refactor Cypress WHD wifi & bluetooth drivers to work better with CMake and be vendor agnostic

* Fix some missed changes that belong in the other branch

* Fix build of Cypress targets that use the RTOS adapter.  Make it possible to build Cypress targets in baremetal mode via CMake.

* Try and fix check failures

* Fix a couple unintentional changes
2024-07-05 01:12:21 -07:00
Jamie Smith de882e6e09
Move SPINAND flash out of the Mbed source tree (#295)
* Move SPINAND flash out of the Mbed source tree

* Also remove from drivers.json5

* Fix comment
2024-06-30 15:36:45 -07:00
Wang Xu 8826c613db
fix CMake errors on Cortex-A targets (#293) 2024-06-26 00:05:49 -07:00
timIdeaTech b5e52f0606
fix ambiguous global enum definition for SPI in OSPIFBlockDevice driver (#291)
* fix ambiguous SPI enum definition in OSPIFBlockDevice driver

* remove ' ' after * in comment

* remove comment link from SPI reference

* change to class specific doxygen link for SPI dma hint comment

* Fix submodule hash
2024-06-24 08:59:03 -07:00
Jamie Smith 02623ff442
Remove unavailable and EOLed target boards - Ambiq (#290) 2024-06-21 01:16:10 -07:00
Jamie Smith 65519018b0
Remove unavailable and EOLed target boards - Samsung (#289) 2024-06-21 00:59:59 -07:00
Jamie Smith caaafee2e7
Remove unavailable and EOLed target boards - Cypress/Infineon (#288)
* Remove unavailable and EOLed target boards - Cypress/Infineon

* Oops also update json files
2024-06-20 23:06:04 -07:00
Jamie Smith 8956a75bd9
Remove unavailable and EOLed target boards - STM32 (#287)
* Remove unavailable and EOLed target boards - STM32

* Make CI detect any missing MCU descriptions

* Oops fix CI syntax

* Aaand add those MCUs

* Also remove "orphaned" cellular modem COMPONENTs
2024-06-20 21:35:53 -07:00
Jamie Smith dfac17ba38
Reorganize targets.json5, add image URLs to all targets (#286)
* Start adding images to each target in targets.json5

* Fix a few errors

* Assign images to lots more stm32 MCUs

* Moar image URLs

* Reorganize EFM32 targets

* Add images for nrf devices

* Images for Cypress and (most) Nuvoton targets

* Fix incorrect property name

* All images added!
2024-06-19 22:47:46 -07:00
Jamie Smith 687a94b0d9
STMicro: Improve PWM resolution (#283)
* STMicro: Improve PWM resolution

* Update all objects.h, rename counts -> top_count

* Revert pin mode change, seems to be not needed
2024-06-19 17:50:31 -07:00
Jamie Smith f442436741
Fix PwmOut::resume() for static pinmap usage (#281)
* Fix PwmOut::resume() for static pinmap usage

* Use function pointers, like SPI does

* Fix style

* Remove "static"

* Revert "Remove "static""

This reverts commit c00929788e5ccfbc8f716cbb32e8079dc0a5fb33.
2024-06-19 11:55:51 -07:00
Jamie Smith 47ee2ce2bb
Re-add CMSIS MCU description file and a utility to manage it (#282)
* Start adding CMSIS MCU description tool

* Add 'add-missing'

* Switch MCU descriptions to JSON5

* Add new MCU after rebase

* Use virtualenv instead of APT for installing packages

* Also remove apt requirements files

* Wrong command!

* Check if index file exists before checking update time

* Respond to comments

* Make must_exist keyword only

---------

Co-authored-by: Victor Tang <me@victorwtang.dev>
2024-06-09 20:43:27 -07:00
Jamie Smith b64b6e6186
LPC1768: Rewrite I2CSlave HAL to match datasheet way of doing it (#280)
* LPC1768: Rewrite I2CSlave HAL to match datasheet way of doing it

* Style and doc fixes
2024-05-23 23:12:10 -07:00
Jamie Smith 87bc6de65a
Add Arduino Nicla Sense ME support (#271)
* Port over Nicla Sense ME arduino target

* Re-add button1

* Fix missing licenses, fix I2C assignment, fix LoRa module descriptions
2024-05-16 01:12:55 -07:00
timIdeaTech 9711f6fb03
Update NUCLEO_H743ZI2.cmake (#279)
stlink-gdb-server failing to connect, add "Initializes the device while under reset condition" --initialize-reset option
2024-05-14 20:54:41 -07:00