Commit Graph

471 Commits (master)

Author SHA1 Message Date
grumpyengineer fbf4ac03d7
Change temp to uint32_t in serial_format
Fix bug where calling set_format in MBED (which calls serial_format) causes the CTRL register to become corrupt due to saving its initial value to a uint8_t when the register is 32 bit wide
2023-02-21 19:51:10 +00:00
grumpyengineer e167992769
Change temp to uint32_t in serial_format
Fix bug where calling set_format in MBED (which calls serial_format) causes the CTRL register to become corrupt due to saving its initial value to a uint8_t when the register is 32 bit wide
2023-02-21 19:32:32 +00:00
Yilin Sun 91ce405796
Targets: NXP: IMXRT: Fixed GCC_ARM lds syntax.
Signed-off-by: Yilin Sun <imi415@imi.moe>
2023-01-02 23:24:12 +08:00
Hari Limaye f4e5359710 GPIO: Use uintptr_t for gpio_irq_api context
The HAL gpio_irq_api stores object IDs, which serve as a form of context
for the dispatch of the interrupt handler in the drivers level
InterruptIn Class. The way this is achieved is that the InterruptIn
Class casts its address to uint32_t, which is stored as the ID.
This results in compilation failure when the size of an object pointer
is greater than uint32_t, for example when building on a PC for unit
testing.

In order to allow Unit Testing of the InterruptIn Class, we replace the
use of uint32_t with uintptr_t (type capable of holding a pointer),
which allows portability and expresses intentions more clearly.
In aid of this latter goal, we also replace the use of the name "id"
with "context", to improve clarity - these are addresses of the context
related to that callback.
2022-01-26 18:12:52 +00:00
Hari Limaye b493a15a53 CAN: Use uintptr_t for can_irq_ids
The HAL can_api stores an array of IDs in order to dispatch interrupts
to the correct CAN object. The drivers level CAN Class casts a pointer
to itself to an uint32_t, which is stored as the ID and then cast back
to a CAN * in order to call the correct handler. This results in
compilation failure when the size of an object pointer is greater than
uint32_t, for example when building on a PC for unit testing.

In order to allow Unit Testing of the CAN Class, we replace the use of
uint32_t with uintptr_t (type capable of holding a pointer), which
allows portability and expresses intentions more clearly. In aid of this
latter goal, we also replace the use of the name "id" with "context",
to improve clarity. These are addresses of the context related to that
callback.
2021-09-17 13:36:43 +01:00
Lingkai Dong 351680fb18 Rework post-build to support multiple executables
When building greentea tests, each test is an executable with its
own output binary path. This is also the case when a user project
produces multiple executables. But the current implementation of
post-build operations always assumes there's only one executable,
at the root of the build directory.

The post-build command depends on Mbed target, and it always takes
the the executable we build as an input file. To achieve this, we
let each Mbed target (that has a post-build command) define a function

    function(mbed_post_build_function target)

which takes a CMake executable target as an argument from which it can
get its binary path using generator expressions. It generates and adds
to the passed executable target a post-build custom command.

Notes:
* The function name needs to be exact, because CMake only supports
literal function calls - CMake can't dereference a function name from
a variable. To avoid multiple definitions of this function, each Mbed
target needs to guard it with a macro to check if the user is
building this Mbed target.
* `mbed_post_build_function()` is a function, but it is usually
defined by another macro rather than a parent function, because
nesting functions would make many variables inaccessible inside the
innermost `mbed_post_build_function()`.
* There's no more need to force regenerate images. Previously, post-
build commands were custom *targets* which always got to run, so we
force regenerated images on every build to avoid patching an image
that's already been patched once on previous build. Now post-build
commands are custom *commands* of the same executable target, and they
are only run if the executable target itself is rebuilt.
2021-07-22 17:31:22 +01:00
Anna Bridge 640d844251
Merge pull request #14623 from s-bruce13/master
Updated SDK 2.9.1 and added Flash Support for MIMXRT1170_EVK
2021-05-13 11:18:05 +01:00
s-bruce13 659f0bbe07 adding flash support
adding flash support

Updated SDK 2.9.1 and added Flash Support
2021-05-10 11:31:33 -05:00
s-bruce13 0f4bc86a21 Updated drivers to SDK to 2.9.1 2021-05-07 08:29:53 -05:00
James Norton f906707d0f Changed LED definitions to be compliant with Generic Pin Naming standard
Removed I2C_SCL and I2C_SDA from PinName enum as these are now defined in PinNameAliases.h
2021-05-06 11:36:14 -07:00
James Norton 36d449a27d Added Support for ARDUINO_UNO Form Factor on TARGET_MIMXRT1050.
Renamed D0..D15 and A0..A5 to ARDUINO_UNO_D0 etc.

This allows user to use ARDUINO_UNO as the supported_form_factors in targets.json for MIMXRT1050_EVK.
2021-05-05 12:34:34 -07:00
Martin Kojtal 376fda5bf5
Merge pull request #14505 from s-bruce13/master
Adding NXP TARGET- MIMXRT1170_EVK
2021-05-04 11:28:07 +02:00
s-bruce13 f4045f9440 Fixed reference for GPT driver 2021-04-28 08:14:49 -05:00
s-bruce13 2398d86107 Adding ARM support 2021-04-27 11:53:37 -05:00
s-bruce13 8d9a60a895 fixed cmakelist to refer to correct library 2021-04-16 07:02:03 -05:00
Martin Kojtal 1fd4cfd798
Merge pull request #14516 from 0xc0170/fix-cmake-project-name
CMake: remove MBED_PATH and use <PROJECT-NAME>_SOURCE_DIR/MODULE_PATH instead
2021-04-15 14:00:21 +02:00
s-bruce13 cdf2d4d0a4 missing analoginapi in cmake list 2021-04-14 09:37:40 -05:00
Martin Kojtal 121c8286da CMake: set CMAKE_MODULE_PATH in the Mbed OS CMakelists.txt
Update CMAKE_MODULE_PATH at once place.

Note, we update also CMAKE_MODULE_PATH in app.cmake. This is temporary until we get a proper way to include
Mbed Os (removing app.cmake need to be included by an application).
2021-04-14 13:09:28 +01:00
Martin Kojtal b6a90c4ae1 CMake: fix for CMAKE_CURRENT_LIST_DIR in functions
CMAKE_CURRENT_LIST_DIR behaves differently in functions. We store it in the CMakeLists itself, so anyone
calling a function would get the actual list dir where the scripts are.

To illustrate: if I call a function from src/CMakelists.txt, function located in src/scripts, `CMAKE_CURRENT_LIST_DIR` in the function would point
to the src/ folder but not to src/scripts.
2021-04-14 13:09:27 +01:00
Martin Kojtal dfc4010e24 CMake targets: remove MBED_PATH, use stadard variables
- list files included via module path
- <project-name>_SOURCE_DIR for sources that are out of the current processed CMake
- CMAKE_CURRENT_LIST_DIR for listfiles
2021-04-14 13:09:26 +01:00
s-bruce13 96349d7445 Removed unnecessary commented lines in PinNames.h 2021-04-12 09:49:18 -05:00
s-bruce13 d12fa879ac Revert "Removed unnecessary commented lines from PinNames.h"
This reverts commit 0adc3fd570.
2021-04-12 09:48:40 -05:00
s-bruce13 0adc3fd570 Removed unnecessary commented lines from PinNames.h 2021-04-12 09:47:46 -05:00
s-bruce13 e2c2b2ba6f Fixed CMake Error
Jenkins CI cmake error
2021-04-06 14:24:38 -05:00
s-bruce13 56450aa979 Adding NXP TARGET- MIMXRT1170_EVK
Base Functionality, UART, Timers, I2C , SPI, ADC
2021-04-06 10:42:37 -05:00
Harrison Mutai a6d2c5f1c5 Add bare metal support to NXP targets
Modify linker scripts to add heap to memory map, add list of supported c libs and "bare-metal" to supported_application_profiles.
2021-03-31 15:04:42 +01:00
Harrison Mutai d6b6da93ed Remove µARM toolchain dependencies from NXP targets 2021-03-31 15:04:41 +01:00
George Psimenos 61cfaa15cd Update UART pin names & add MBED_CONF_TARGET_STDIO_UART overrides 2021-03-23 11:17:17 +00:00
George Psimenos 885cdef5f7 Add standard pin-names validation script & tests 2021-03-18 17:01:53 +00:00
Martin Kojtal 98143e48cf
Merge pull request #14323 from artokin/update_from_feature_wisun
Bring in MIMXRT1050_EVK changes from feature-wisun branch
2021-03-08 15:39:40 +00:00
Lingkai Dong 848341112e NXP: Query precise application names in post build
This removes the need to use "glob" a file extension, and uses
precise application names.
2021-03-04 10:28:22 +00:00
Arto Kinnunen ad3bb0dc72 Change file permissions from 755->644 2021-03-03 13:45:58 +02:00
Arto Kinnunen 7498683b4f Change file permissions from 755->644 2021-03-01 10:20:54 +02:00
Hugues Kamba 03914d1875 CMake: Remove references of APP_TARGET
This needs to be removed as there should not be a
name requirement for application CMake variable name.
Furthermore, in certain uses cases it prevents
successful builds for some Mbed targets. For instance
when building Greentea test applications for Mbed
targets that require post build operations as they do
not define APP_TARGET.
2021-02-23 17:24:31 +00:00
Gavin Liu 59ad3ca7dc targets:evkbimxrt1050: Adjust the SEMC re-order rules
Update the BMCR0, BMCR1 registers to adjust the SEMC
re-order rules. This can improve the SDRAM stability
under multiple AXI masters system.

Signed-off-by: Gavin Liu <gang.liu@nxp.com>
2021-02-22 18:31:59 +02:00
Tim Wang 1ee4239253 targets:RT1050: Fix the flash erase and program issue for qspi nor flash.
Update the LUT to fix the winbond qspi flash erase issue.
Update the page program interface to fix the qspi flash program issue.

Signed-off-by: Tim Wang <tim.wang@nxp.com>
2021-02-22 18:31:59 +02:00
Tim Wang 9c3c3d2dcc targets:RT1050: Fix the low speed switch issue
Fix the low speed switch issue when using QSPI flash

Signed-off-by: Tim Wang <tim.wang@nxp.com>
2021-02-22 18:31:59 +02:00
timwang b14ddf69b7 targets:clock: Update the coreclock value
Update the coreclock value which will be used in middleware

Signed-off-by: timwang <tim.wang@nxp.com>
2021-02-22 18:31:59 +02:00
timwang 8aca242b70 targets: clock: change default core clock to 528M
change the clock config of the RT1050 to set the default core clock to
528M

Signed-off-by: timwang <tim.wang@nxp.com>
2021-02-22 18:31:58 +02:00
timwang 4bc62d9a13 targets:uart: Add uart_3 support
Add uart_3 support, which using GPIO_AD_B1_06 as TX pin, GPIO_AD_B1_07
as RX pin

Signed-off-by: timwang <tim.wang@nxp.com>
2021-02-22 18:31:58 +02:00
TimWang 1ec914c5db targets:lpspi: Update the lpspi driver and api
Change the lpspi default transfer delays to fix the data corruption
issue.

Add the loop and judgement to retry transfer when spi bus is busy.

Add the judgement statement to fix the hang issue.

Signed-off-by: TimWang <tim.wang@nxp.com>
2021-02-22 18:31:58 +02:00
Gavin Liu 436f5ca8e7 targets:MIMXRT1050: Add LPSPI4 support
Add LPSPI4 PIN configurations.

Signed-off-by: fred.li <fred.li@arm.com>
Signed-off-by: Gavin Liu <gang.liu@nxp.com>
2021-02-22 18:31:58 +02:00
Hugues Kamba 2c3481297c CMake: Create CMSIS library targets to remove dependency on MBED_TARGET_LABELS
This goes towards eventually removing reliance on targets.json to specify
the requirements of Mbed targets.
2021-02-19 13:39:32 +00:00
Hugues Kamba 68b6e6ff96 Fix post build mechanism with unique CMake custom targets
The CMake custom target must be unique to avoid more than one
Mbed target adding the same. Only the CMake custom command added for the
Mbed target being built is run as the custom CMake target now includes
the Mbed target name.
2021-02-15 17:39:27 +00:00
Hugues Kamba deeaa7970f CMake: Add post build operation support
A CMake custom target, mbed-post-build, is added as a dependency of the
application CMake target if a Mbed target adds a CMake custom target
named mbed-post-build-bin. mbed-post-build-bin is added as a dependency
of mbed-post-build. mbed-post-build-bin depends on the application binary.
This is done so a CMake custom command that executes post-build can be added.

The Python scripts that implement the operations have been modified to add
CLI entry points so they can be called from CMake. Dependency on the old
tool has been removed on those scripts by passing them exactly what they
require instead of passing old tool Python objects. A consequence of that
was to slightly amend how the old tool calls some of those Python modules.

Support has only been added for Mbed targets that currently have a requirement
for post build operations. This includes: LPC1114, LPC1768, ARCH_PRO, LPC54114,
LPC546XX, FF_LPC546XX, CY8CKIT064B0S2_4343W, CYTFM_064B0S2_4343W, CYSBSYSKIT_01

The following targets are not supported as TFM support is not yet included:
ARM_MUSCA_B1, ARM_MUSCA_B1_NS, ARM_MUSCA_S1, ARM_MUSCA_S1_NS.
2021-02-11 17:04:41 +00:00
Hugues Kamba f6837ce82d CMake: Refactor NXP targets
Refactor all NXP targets to be CMake build system targets. This removes
the need for checking MBED_TARGET_LABELS repeatedly and allows us to be
more flexible in the way we include MBED_TARGET source in the build.

A side effect of this is it will allow us to support custom targets
without breaking the build for 'standard' targets, as we use CMake's
standard mechanism for adding build rules to the build system, rather
than implementing our own layer of logic to exclude files not needed for
the target being built. Using this approach, if an MBED_TARGET is not
linked to using target_link_libraries its source files will not be
added to the build. This means custom target source can be added to the
user's application CMakeLists.txt without polluting the build system
when trying to compile for a standard MBED_TARGET.
2021-02-10 21:36:39 +00:00
Hugues Kamba dd6c5b3ab0 NXP: Remove LPC55S69 CMake listing
Support for LPC55S69 had been removed without removing references in CMake.
2021-01-22 11:13:02 +00:00
Hugues Kamba 425b9a7311 NXP: Use armclang shebang in scatter files
The armclang shebang is required in the scatter file in order to build with CMake.
2021-01-22 11:11:42 +00:00
Hugues Kamba 1ca4b1a34f NXP: Fix heap size formula in scatter files
The heap size was incorrectly calculated.
This fixes it by subtracting the Stack size, any memory chunks allocated
before the start of the application (for vectors and/or crash report), and
finally the size of the application from the total RAM size.
2021-01-08 18:29:03 +00:00
Hugues Kamba cf23ba5388 CMake: Add support for TARGET_MCUXpresso_MCUS targets
All TARGET_MCUXpresso_MCUS targets supported by Mbed OS
can now be built with CMake.
2020-12-10 11:29:08 +00:00