Commit Graph

208 Commits (15ab0c38fd10f2f63b65a9141f8dd4880307f8b8)

Author SHA1 Message Date
Jamie Smith 2564b2c1bf
STM32H7: Don't use DTCM memory for heap (#396)
* STM32H7: Don't use DTCM memory for heap

* Update CM4 linker script assertion
2024-11-26 20:35:55 +01:00
Jamie Smith b2d11fcf6e
Reactivate some tests and functionality that had accidentally been disabled due to incorrect checks (#372)
* Start on fixing some unintentionally skipped tests

* Reactivate stats tests

* CI fixes

* Include cinttypes

* Fault & crash data RAM working on STM32H7!
2024-10-14 09:56:11 -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
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
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
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 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
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
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 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 6e2e7b9414
Remove all source files exclusive to Arm Compiler and IAR (#159)
* Remove all source files exclusive to Arm Compiler and IAR

* Also remove 'TOOLCHAIN_ARM'

* Remove targets.json entries for ARM and IAR
2023-05-15 08:23:01 -07:00
Ladislas de Toldi 3176fc7ca5
mbed-ce@master + fixes + gcc 11 support (#135)
* Fix rtos::Mutex stub, add trylock() method

* LowPowerTicker - Add ::attach(...) method + call callback

* mbed_power_management - rename sleep --> mbed_sleep to avoid conflicts

Fixes conflicts w/ unistd.h and boost::ut

* GCC 11/C++ 20 - Remove deprecated type_traits

* GCC 11/C++ 20 - Remove redundant templating of methods

* Warning - pragma ignore invalid-noreturn for unit tests

* Fix astyle errors

* Fix missing mbed_sleep() calls
2023-02-21 09:04:34 -08:00
Jamie Smith 32a9080c7d
Enable Arduino Nano 33 BLE (#55)
* Add upload target for Arduino Nano 33 BLE, fix linker script preprocessing, add option for USB serial by default

* astyle error

* Use HINTS instead of PATHS so that the Arduino dir is searched first

* Enable OpenOCD and PyOCD for Nano 33 BLE in SWD mode

* Fix missing dependency for USB tests on Windows

* Add RAM defines for nrf52840

* Fix mbed-storage-kv-config depending on SD card library even if said library was not enabled

* Update dsrdtr value

* No longer need to modify linker script now that we aren't using whole-archive!

* Add OPENOCD_ADAPTER_SERIAL

* Add handling for cmsis dap

* Fix typo

* Fix weak symbol issue causing Bluetooth to not work.  In this case, the weak implementation can simply be removed, because there's no legitimate case where it is used.
2022-10-16 10:32:38 -07:00
Jamie Smith d83dbc2ac4 Fix ABI differences between mbed-baremetal and mbed-os, remove PlatformMutex 2022-09-14 00:25:30 -07:00
Jamie Smith c11d32fbf4 - Split mbed-core and mbed-rtos into -sources and -flags targets
- Fix some logic errors in top level cmakelists related to building greentea tests
- Fix mbed_create_distro() for OBJECT libraries
2022-09-14 00:25:25 -07:00
Casper Meijn 904f867bdc semihosting: Fix typo in semihost_rename
Fix typo in semihost_rename. Now it actually sends the `new_name` as well as the `old_name`.
2022-04-26 07:24:27 +02:00
Martin Kojtal d4c6b37cad
Merge pull request #14610 from jeromecoutant/DEV_SLEEP_TRACE
Power management stat : add verbosity level for MBED_SLEEP_TRACING_ENABLED
2021-11-08 15:11:18 +00:00
jeromecoutant 658e9ae972 Power management stat : add verbosity level for MBED_SLEEP_TRACING_ENABLED
Full verbosity is adding a console line for each lock/unlock API call

- stats can be enabled with json config
- default configuration is full verbosity and add a console line for each lock/unlock command
- for STM32 targets, verbosity is reduced by default
2021-11-08 09:46:06 +01:00
sytse 43f0c14c9a Code style violation corrected 2021-10-29 13:45:32 +02:00
sytse b99584d16d Fixed floating point formatting
When decimal_prec is 0 and the value is negative and needs rounding subtract 1, instead of adding 1
When decimal_prec > 0 round before printing the integer part, instead of after
2021-10-29 13:40:29 +02:00
Lingkai Dong 8d32b668ec Workaround for a bug in malloc() from newlib-nano 4.1.0
The commit 84d0689 "Nano-malloc: Fix for unwanted external heap
fragmentation" from newlib 4.1.0 introduced several optimizations,
one of which is as follows:

When the last chunk in the free list is smaller than requested,
nano_malloc() calls sbrk(0) to see if the heap's current head is
adjacent to this chunk, and if so it asks sbrk() to allocate the
difference in bytes only and expands the current chunk.

This doesn't work if the heap consists of non-contiguous regions.
sbrk(0) returns the the current region's head if the region has any
remaining capacity. But if this capacity is not enough for the second
(non-trivial) call to sbrk() described above, allocation will happen
from the next region if available. Expanding the current chunk won't
work and will result in a segmentation fault.

So this optimization needs to be reverted in order to bring back
compatibility with non-contiguous heaps. Before the next version
of newlib becomes available and gets updated in the GCC Arm Embedded
Toolchain, we work around this issue by including the fix in Mbed OS.
The linker prioritizes malloc() from the project to the one from the
toolchain.
2021-09-01 17:21:32 +01:00
Martin Kojtal 38ca4bdce4 semihosting: add compat header where is required
ARMCC provides __semihost via compat header. As CMSIS 5.8.0 removed this compat header,
we need to explicitly include it to fix definition missing error.
2021-07-29 14:31:38 +01:00
Martin Kojtal 8bdec2b4db retarget: move compat header for ARMClang prior any cmsis headers
Reference: CMSIS 5.8.0 known issues and https://github.com/ARM-software/CMSIS_5/issues/1211

This fixes the error about redefinition of enable/disable irq. we need compat header because of
semihosting (not yet provided in CMSIS).
2021-07-29 14:31:33 +01:00
Jaeden Amero b5c2f7079e
Merge pull request #14718 from Meano/develop
Feature: Make changes for Cortex-A5 support
2021-07-01 10:23:41 +01:00
Tymoteusz Bloch f1663e794a Disable override errno erro value
Disable setting own values of flags for fcntl() function if they are defined
2021-06-25 17:12:55 +02:00
Meano ff2188150a Make changes for Cortex-A5 support 2021-06-23 13:36:55 +08:00
Meano 6feca90589 Unify the __CORTEX_A macro in the files containing cmsis.h 2021-06-23 13:36:52 +08:00
Tymoteusz Bloch bdb0a22dec Fcntl setting Non Blocking operations improvement 2021-06-09 15:36:24 +02:00
Werner Lewis 046fa78319 Update GCC except.S to support ARMC6
ARM Compiler 6 supports GNU-style assembly with armclang. Instead of
relying on armasm with the legacy syntax, GCC except.S is updated so
that it can be used with ARM as well as GCC_ARM toolchains. CMake is
updated to use this version.
2021-05-24 13:54:57 +01:00
Martin Kojtal 3003a171b2 fixup! error: use __INITIAL_SP from cmsis instead of RTX one 2021-05-10 16:09:18 +01:00
Martin Kojtal f6176432d2 error: use __INITIAL_SP from cmsis instead of RTX one
We used to require INITIAL_SP as rtx target headers define it. This should not be required, as
cmsis already defines symbol  __INITIAL_SP for all toolchains.

Fixes #14432
2021-05-05 13:15:10 +01:00
George Psimenos d239ef98cd Rename USBTX/RX to CONSOLE_TX/RX 2021-03-18 17:01:54 +00:00
jeromecoutant a4350f72bd [STD-PIN] BUTTON and LED define
hal/tests/TESTS/mbed_hal/gpio/main.cpp is replaced by
hal/tests/TESTS/pin_names/generic/main.cpp now
2021-03-18 17:01:50 +00:00
jeromecoutant a6c213bb10 [STD-PIN] Replace STDIO_UART_TX by USBTX 2021-03-18 17:01:50 +00:00
Lingkai Dong 4450464fc8 Add integer overflow check to the malloc wrappers
Add a check that the combined size of the buffer to allocate and
alloc_info_t does not exceed the maximum integer value representable
by size_t.
2021-03-10 09:47:15 +00:00
Martin Kojtal 85c2d7a25c CMake: remove IAR references as they are not supported 2021-02-17 09:19:03 +00:00
Martin Kojtal 09dd4d2582 CMake platform: remove IAR related CMakeLists
Not supported
2021-02-17 09:15:50 +00:00
caodd 9a7b2a8647 Fix minimal-printf floating point decimal output error 2021-01-20 20:54:34 +08:00
Martin Kojtal c06fcaf5c5
Merge pull request #13548 from evva-sfw/enhance-minimal-printf
Add width modifier and prepending zeros for hexadecimal output and decimal precision for floating point
2020-12-10 09:14:59 +00:00
Oliver Wildtgrube 03cf6214c3 Add width modifier and prepending zeros for integer, hexadecimal and floating point output as well as decimal precision for floating point 2020-12-08 21:07:54 +01:00
Martin Kojtal 124afe79bb
Merge pull request #13755 from AGlass0fMilk/fix-init-os-timer
Fix MBED_ERROR call in init_os_timer
2020-11-24 13:38:46 +00:00
Martin Kojtal 57bbb4739b
Merge pull request #13085 from pea-pod/remove-deprecated-mbed-assert
Change MBED_STATIC_ASSERTs version for built-in
2020-11-24 13:38:07 +00:00
George Beckstein 7571982606 Fix MBED_ERROR call in init_os_timer 2020-11-19 12:35:34 -05:00
Martin Kojtal 3555ada459
Merge pull request #13867 from marcemmers/fix-systimer-overflow
SysTimer: Prevent unacknowledged tick overflow when halted for a while
2020-11-11 08:55:24 +00:00
Hugues Kamba 794e32df74 CMake: Use relative paths to list source files and directories
The absolute path is still required for listing linker
files as they are referenced from a function in the top
level CMake input source file.
2020-11-09 12:32:30 +00:00
Rajkumar Kanagaraj e7c0d93ad4 CMake: add mbed-os and mbed-baremetal targets
mbed-os consists of mbed-core and mbed-rtos
mbed-baremetal consists of mbed-core

The main change is for mbed-core. Changing from object library to be interface. This way it allows us to do the above to have 2 main targets for users to use.

This should be backward compatible change as mbed-os target we used contains the same files/options as previously set.
2020-11-06 17:25:22 +00:00
Hugues Kamba bf84a5b329 CMake: Rename CMake targets
* mbed-os renamed mbed-core
* mbed-os-<COMPONENT> renamed mbed-<COMPONENT>
2020-11-06 17:25:22 +00:00
Hugues Kamba fa98689639 CMake: Componentize Mbed OS into multiple CMake targets (#13732)
Aside from the core mbed-os CMake target, a number of targets have been created so they can optionally be included by application executables that require them using `target_link_libraries()`.

Co-authored-by: Martin Kojtal <martin.kojtal@arm.com>
Co-authored-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@arm.com>
2020-11-06 17:25:21 +00:00
Hugues Kamba 1b576c3046 CMake: Clean up platform 2020-11-06 17:25:20 +00:00
Hugues Kamba a0fbe2947a CMake: Fix build failure due to CMSIS restructure 2020-11-06 17:25:20 +00:00