* 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
FixesARMmbed/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>
* 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>
* 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>
* 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
* 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
* 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!
* 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>
* 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
* 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
* 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
* 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>
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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>
* 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.
* Attempt to fix declaring an OSPIFBlockDevice as a global object
* Astyle format
* Add B_U585_IOT02A upload method support and default OSPIF mappings. Guard against incorrect case on upload method
* Also fix the same error in QSPIFBlockDevice
* Fix compile error for mbed-wifi
* Provide ScopedMutexLock for unittests mode
* Add PICO SDK
* Add RP2040 HAL implementation
* Add target Raspberry Pi Pico and its Upload method
* Modified PICO SDK-RTC because of conflict in name
* Use USB from boot, fix USB linking
* Try removing redundant init call
* Add SWD upload configuration, copy most init code from Pico SDK
* Fix RTC linking, fix ram size constant, fix test warning
* Add upload support for RPi Pico devices using Picotool
* Fix implementation of Tx IRQ for serial ports. BufferedSerial works now!
* Make PinNames.h pass pin validation
* Fix us ticker not working when debugging
* Fix us ticker double-init and manual fire interrupt function, us ticker tests now pass!
* Fix writing to rtc and rtc double-init, RTC tests now pass (except rtc-reset)
* Fix panic() not working from a critical section or ISR
* Fix compile failure due to extra LED1 definition
* Fix style
* Fix flash_api detection of invalid parameters, fix reset_reason to advertise the correct capabilities and implement them correctly
* Fix watchdog test warnings, fix broken hal_watchdog_get_reload_value(), fix missing frequency field in watchdog features
* Fix watchdog_reset failing to compile on some devices
* Fix us ticker fire_interrupt() not being callable from an ISR
* Fix incorrect license header
---------
Co-authored-by: Johnk1987 <odiin@seznam.cz>