Commit Graph

3973 Commits (7edab2d1ce877a3a8b96a2a924dd68de003df982)

Author SHA1 Message Date
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 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 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 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 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 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
JojoS 5b25b173c8
fix argument number for custom linker script (#169) 2023-07-17 19:54:05 -07:00
Jamie Smith a639176603
Fix declaring OSPIFBlockDevice and QSPIFBlockDevice as globals, fix some STM32U585 issues (#167)
* 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
2023-07-17 19:52:38 -07:00
Jamie Smith a9f8e097e2
Add RP2040 support (#168)
* 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>
2023-07-12 21:11:26 -07:00
Jamie Smith 785e3fb87b
Improve usability and documentation of the SPI API (#165)
* Make TRANSACTION_QUEUE_SIZE_SPI a proper option instead of a weird macro

* Document DMAUsage constant

* Copy over reworked SPI header

* Spelling -_-

* Document SPI event flags
2023-06-25 19:44:34 -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
Jamie Smith b9c04813b3
More fixes for sleep and clocking stuff on MIMXRT105x (#158)
* More fixes for sleep and clocking stuff on MIMXRT105x

* Fix a couple of inadvertent changes
2023-05-11 22:49:55 -07:00
Jamie Smith 04a76b3882
Refactor MIMXRT105x target labels and linker script, locate general data in DTCM memory instead of OCRAM for improved performance (#157) 2023-05-11 13:04:31 -07:00
Jamie Smith af6d50aefe
Teensy 4.1 port with Ethernet support (#144)
* Start porting to Teensy 4.1, also fix some compiler warnings in FSL HAL

* Add hardware init for Teensy, refactor phy drivers, rework IMX EMAC autonegotiate code

* Revert some testing changes

* Fix incorrect phy address used outside of low_level_init_successful()

* Ethernet operational!

* Turn off DEBUG_IMX_EMAC

* Style fixes

* Style again

* Bugfix: mbed_lib.json files in project source dir were not getting picked up

* Bugfix: CLion debug configurations not generated properly due to variables going out of scope

* Support Teensy OTP MAC address
2023-03-08 20:18:33 -08:00
Ladislas de Toldi 16247af752
🔧 (profiles): Remove debug symbols from release profile, compress debug sections (#147) 2023-03-02 21:19:15 -08:00
Ladislas de Toldi 4124a9a67d
(vscode + cmake) Add option MBED_GENERATE_VSCODE_CONFIG (#142) 2023-02-27 22:47:51 -08:00
Jamie Smith d9534516bf
Fix debug-less upload methods (#140)
* Fix debug-less upload methods

* Oops, fix build outside of Clion
2023-02-24 00:26:08 -08:00
Jamie Smith eda766ec8f
Refactor upload methods to streamline the debugging experience (#129)
* Change all debug configurations to not reset and exit on error.  Initial tasks.json implementation.

* st-util working on command line and VS Code!

* Convert STM32CUBE, fix spaces in GDB server task command

* pyocd working!

* Convert OpenOCD

* Convert JLINK

* Convert REDLINK upload method

* Fix CMake typo

* Try and fix some variable scope issues

* Initial CLion implementation.  Need to test with hardware.

* Add a separate task that kicks off a build before each debug session
2023-02-20 00:16:15 -08:00
Jamie Smith ccb664ea6f
Update MIMXRT clocking to hopefully fix deep sleep, fix boot issues on Teensy4 (#130)
* Fix incorrect image length in header preventing boot

* Fix ncache region being located in SEMC even on boards without it

* Don't reserve RAM for ncache anymore

* Fix crash when activating BufferedSerial on Teensy D0 and D1.  Also fix incorrect daisy register mapping.

* Fix missing space in linker script

* Start on fixing incorrect MIMXRT clock frequency

* LPM working!

* Clean up LPM and clocking

* Add teensy model identifier

* Fix license headers
2023-02-14 22:21:28 -08:00
Jamie Smith b91fc218ac
MIMXRT1060_EVK and Teensy 4.0 support (#113)
* Initial attempt at Teensy 4.0 support

* Hide internal target

* Fix some targets.json issues, add boot code for the MIMXRT1060_EVK.  It boots but tests aren't able to run properly yet.

* Disable LPTICKER on MIMXRT1060, fix pin names for newer dev kits

* Enable MIMXRT106x ethernet
2023-01-09 08:48:25 -08:00
Jamie Smith 5f30094ed5
Enable disabling target files for custom targets (#107)
* Enable disabling target files for custom targets

* Fix unittests

* Fix unittests again
2022-12-02 20:32:37 -08:00
JojoS 9d9ba58f68
add custom linker script (#103)
* add custom linker script
a custom linker script can be applied by adding the .ld filepath
as 2nd argument to mbed_set_post_build

* more detailed comment

* add if is_standalone for text cases

* replace COMMENT in add_custom_command by echo
COMMENT is not reliable printed
2022-11-28 09:01:49 -08:00
JojoS e4469c3b24
add depth, json and html to memap (#95) 2022-11-12 23:18:55 -08:00
Jamie Smith 72832c7bba
Add upload method support for MIMXRT1050 EVK (#84) 2022-11-06 16:13:10 -08:00
JojoS 0840a295eb
add separate cxx options for gcc (#80)
* add separate cxx options for gcc

* remove warning write-strings
2022-11-05 13:15:02 -07: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 ce093f1785
Don't use whole-archive linking (#71)
* First attempt at converting to OBJECT libraries.  Not working due to more object library limitations

* Only compile the main libraries as OBJECT, because that's all that CMake can be made to do right now.

* Fix availability of target-specific flags

* Missed some usages

* Fix some STM32 ethernet stuff that was not linking correctly

* More fixes for STM32 ethernet and weak symbols

* Fix prebuilt object file linking for MUSCA_S1

* Fix STM32 eth init license headers
2022-10-09 12:16:15 -07:00
Jamie Smith ffc33676d1
Lots of usability improvements for the I2C API. Better docs and new top-level functions. (#64)
* Lots of usability improvements for the I2C API.  Better docs and new top-level functions.

* Document frequencies

* Tabs to spaces

* More style fixes

* Run astyle

* Clean up docs

* Add note about addressing, change 10 bit to 11 bit

* Fix spellcheck

* Fix paste error

* Oops, fix accidental change
2022-10-02 21:27:33 -07:00
Jay Sridharan e833ba1701
Add docs generation workflow (#45)
* Add docs generation workflow

* remove extraneous backslash
2022-09-26 08:15:30 -07:00
Jamie Smith 1d44be27c6
Fix issue with Python exit codes that masked failures (#56) 2022-09-25 09:08:56 -07:00
Jamie Smith 7cd7e60df8
Convert mbed-usb target, enable mbed-usb tests (#49)
* Convert mbed-usb target, enable mbed-usb tests

* Fix ByteBuffer compile error

* Add missing requirements, fix some pyserial issues

* Move CDC_ECM to its own target since it needs RTOS
2022-09-22 00:17:45 -07:00
Jamie Smith f317dbc335
Print the command when a greentea test is being run. Also fix mbedhtrun not being on PATH causing all tests to pass! (#51)
* Print the command when a greentea test is being run.  Also fix mbedhtrun not being on PATH causing all tests to pass!

* Also remove useless -f argument to mbedhtrun (not used with --skip-flashing)
2022-09-19 21:38:57 -07:00
Jamie Smith 2b6d60e1ac Oops, missed a file 2022-09-14 00:25:32 -07:00
Jamie Smith 4897b885d6 Change linker script handling logic to use only one linker script target 2022-09-14 00:25:32 -07:00
Jamie Smith d149b84786 Fix OpenOCD not working for L452RE, fix running tests with a non-default baudrate set, add warning about old stlink versions which may not work 2022-09-14 00:25:32 -07:00
Jamie Smith 8296cb6d39 Silence noisy print, fix bug with MBED upload method not working 2022-09-14 00:25:32 -07:00
Jamie Smith b08e9faacc Install mbed os tools by default so that MBED upload works out of the box 2022-09-14 00:25:32 -07:00
Jamie Smith 381df1257f Move UploadMethods.md to wiki, add install path guessing to Findstlink for Windows 2022-09-14 00:25:31 -07:00
Jamie Smith 2ff0a9829f Switch to cortex-debug plugin for VS Code to improve debugging experience 2022-09-14 00:25:31 -07:00
Jamie Smith b60a26526d Add in mbed-cmake's configuration generators 2022-09-14 00:25:31 -07:00
Jamie Smith 222bf9730e Clean up detection of failed generation / missing include file 2022-09-14 00:25:31 -07:00
Jamie Smith e3d717138b MBED_APP_JSON_PATH should no longer be required, as some projects don't need it 2022-09-14 00:25:31 -07:00
Jamie Smith eb2bd8672a Add automatic execution of mbedtools configure 2022-09-14 00:25:30 -07:00
Jamie Smith 9ed98244af Fix typo in yaml 2022-09-14 00:25:30 -07:00
Jamie Smith 5442e2405c Use a cleaner CMake method to handle bin and hex file names 2022-09-14 00:25:30 -07:00