Commit Graph

4009 Commits (c3f9a8ac07df6f92ddd98af448d4fcf9ae20604f)

Author SHA1 Message Date
JohnK1987 0fb002c6c9
Update cmsis_mcu_descr.py for custom targets (#394)
* Update cmsis_mcu_descr.py for custom targets

the fetch-missing is scanning also custom_target.json5 file if exist in project, for help not solve missing memory banks

* Update cmsis_mcu_descr.py for auto search custom_targets.json file

* Update cmsis_mcu_descr.py - rework for remove global var

* Update cmsis_mcu_descr.py - fix
2024-11-24 15:17:50 -08:00
ccli8 ab43414e74
Upload: Fix mbed_adjust_upload_debug_commands for multiple targets (#391)
The purpose of mbed_adjust_upload_debug_commands() is to adjust
first version of MBED_UPLOAD_LAUNCH_COMMANDS. For multiple executalbe
cmake targets, MBED_UPLOAD_LAUNCH_COMMANDS becomes not fresh and may
cause error. To overcome this, one new cmake cache variable
MBED_UPLOAD_LAUNCH_COMMANDS_BAK is introduced to save first version of
MBED_UPLOAD_LAUNCH_COMMANDS.
2024-11-21 08:55:35 -08:00
ccli8 cda8a9d3c8
Support override of memory_bank_config in mbed_app.json (#381)
memory_bank_config can be defined in targets.json or custom_targets.json
per-target, but cannot by application. This enables this override by
adding "target.memory_bank_config" config in target_overrides section of
mbed_app.json as usual.
2024-11-17 18:52:36 -08:00
Jamie Smith d46739ba2e
Fix relative paths to custom upload method file, fix incorrect CAN length on STMicro (#380)
* Fix relative paths to custom upload method file, fix incorrect CAN length on STMicro

* Wait we can do this better
2024-11-14 20:19:30 -08:00
Jamie Smith e72b38a2be
Reactivate EMAC Greentea test (#378)
* Migrate emac test code into a library

* Build passes now!

* Fix STLINK bug, update README

* Reduce verbosity a bit

* Formatting

* Fix licenses
2024-10-29 20:52:57 -07:00
ccli8 7d99fd10c4
Upload: NUVOTON: Change GDB load command to flash post-build processed image (#341)
* Upload: PyOCD: Halt device after UPLOAD_LAUNCH_COMMANDS

For pyocd debug, it appears the device under debug must be halted after
UPLOAD_LAUNCH_COMMANDS, or debugger will become abnormal.

* Convert output to Intel HEX format unconditionally in post-build

This converts output to Intel HEX format unconditionally but to BIN
format just on demand for the following reasons:
1. Most flash programming tools support Intel HEX format, e.g. GDB
   load command.
2. Output can have large holes in addresses which BIN format cannot
   handle and can generate very large file.

* Upload: Support adjustment of debug commands for debug launch

This gives chance to adjust GDB commands MBED_UPLOAD_LAUNCH_COMMANDS
or MBED_UPLOAD_RESTART_COMMANDS for debug launch by implementing
mbed_adjust_upload_debug_commands cmake function.

* Upload: Change GDB load command to flash post-build processed image

With this adjustment, GDB load command changes to "load <app>.hex" from
just "load":
1. "Load" will load <app>.elf and is inappropriate for targets like
   bootloader or TF-M enabled which need to post-build process images.
2. "load <app>.bin" is not considered because GDB load command doesn't
   support binary format.

* Upload: Generate GDB command line gdbinit for multiple application

This enables generating GDB command line gdbinit file for single project
multiple application scenario. The gdbinit file name would be <app>.gdbinit
for distinct among multiple applications.
2024-10-15 09:14:46 -07:00
Jamie Smith edf13ff1a1
Fix a few CMake issues after the recent changes (#371) 2024-10-10 01:54:19 -07:00
Jamie Smith 11369b48be
Add standard upload method variables (#369)
* Start on fixing some unintentionally skipped tests

* Add standard upload method variables

* pyocd works now!!

* Revert "Start on fixing some unintentionally skipped tests"

* Don't require memory banks if not using an upload method

* Oops remove duplicate serial number
2024-10-08 09:14:43 -07:00
Jamie Smith 2f9042fe10
Fix build of CYTFM_064B0S2_4343W (#364)
* Fix build of CYTFM_064B0S2_4343W

* Fix docstring
2024-09-27 09:18:23 -07:00
Jamie Smith f0b9d65ac9
Fix lots of Greentea test warnings (#365) 2024-09-26 12:18:33 -07:00
Jamie Smith 798dd6be43
Fix off-by-1 error in memap's symbol-contained-in-memory-bank check, clean up some linker script stuff (#362)
* Fix off-by-1 error in memap's symbol-contained-in-memory-bank check, clean up some linker script stuff

* Update comment

* One more typo
2024-09-25 01:01:54 -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
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
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
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 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 428b56ecdd
Allow upload method configs to specify an OpenOCD version range (#340) 2024-09-08 21:48:30 -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 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
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 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 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 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 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 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
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
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
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