While building with ARM toolchain relocation warnings appears
This commit will fix it for MAX32625/30 targets.
The system interrupt function is defined as weak in startup file
and its overvides in other files, Becuase of the functions is overrites
while calling it in startup modile by B XXXXX probably compiler give
info purpose warnings... By using using . instead function name it says
go existing point to the compiler.
Warning detail:
https://www.keil.com/support/man/docs/armerr/armerr_dom1365073159742.htm
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
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.
1. In TF-M, fix NSPE interrupt-disabled NSC call broken. Check:
https://developer.trustedfirmware.org/T966
2. In TF-M, enable mcuboot log enabled forcibly. This is to help check firmware update process.
3. Update readme and script
Import the latest partition headers from upstream. We no longer need to
patch the headers to define the BL2 macro as we now define it in the
scatter files for the MUSCA targets.
We worked around an issue with mbed-cli1 not recognising the BL2 macro
from targets.json by adding patched versions of region_defs.h and
flash_layout.h for ARM_MUSCA targets. In the patched headers we defined
the BL2 macro to ensure it can be picked up by the ARM scatter files
that include the headers.
The current solution is not robust, because it means that the
aforementioned headers easily become out of date. A workaround of
defining the macros in the scatter files which need them was suggested
in https://github.com/ARMmbed/mbed-os/issues/14762
This commit applies the suggested changes to the ARM_MUSCA scatter
files.
The directory structure upstream has changed. Now ARM_MUSCA board
support has been moved under an "arm" subdirectory. Update targets.json
with the new locations.
tfm_ns_interface.c is intended to be overriden by clients to support
different targets. We copy this file from upstream into the mbed-os
platform library. We also have a specific "strong" overridden version
for the NU_M2354 target, which is located in its target library.
Previously the implementations in the platform library were decorated
with __attribute__(weak), and we provided a strong definition for the
NU_M2354 target. This worked fine because of weak linking, the linker
will pick the first "strong" definition and use that, avoiding any ODR
violations. However, upstream have removed __attribute__(weak) from the
function definitions, which caused multiply defined symbol errors when
trying to build the NU_M2354 target.
To work around the above issue, we remove the common definition in the
platform library; instead we copy the file to the Musca B1 and Musca S1
target libaries. This means the appropriate tfm_ns_interface.c is only
included in the build when compiling for the specific target which uses
it.
QSPIF was disabled on CYW9P62S1_43012EVB_01 because its S25FS512S
flash chip has multiple configurations but our SFDP parser did not
support this scenario. Now having added support for this, we can
enable QSPIF (the component label for QSPIFBlockDevice) and QSPI
(the label for Quad-SPI communication).
Change MCUboot image versioning to meet requirements below:
1. Major.Minor.Revision must be non-decremental when used to derive security counter (-s 'auto').
2. Make Major.Minor.Revision+Build incremental to identify the firmware itself through psa_fwu_query().
3. Get around MCUboot failure with TF-M underestimated MAX_BOOT_RECORD_SZ
Import mcu partition header (renamed to partition_M2354_im.h) for resolving peripheral base with security.
Though Mbed is non-secure only and needn't secure peripheral base, some BSP driver code still rely on it.
`HAL_SPI_Receive_IT` HAL function causes dummy reads in 3-wire mode,
that causes data corruption in RX FIFO/register. It isn't possible
to fix it without signification refactoring, but we may prevent data
corruption with the following fixes:
- RX buffer/register cleanup after asynchronous transfer in 3-wire mode
- Explicit RX buffer/register cleanup after SPI initialization
(for cases if we re-create SPI object).
All STM32 families except STM32H7 has the following 3-wire SPI peculiarity in master receive mode:
SPI continuously generates clock signal till it's disabled by a software. It causes that a software
must disable SPI in time. Otherwise, "dummy" reads will be generated.
Current STM32 synchronous SPI 3-wire implementation relies on HAL library functions HAL_SPI_Receive/HAL_SPI_Transmit.
It performs some SPI state checks to detect errors, but unfortunately it isn't fast enough to disable SPI in time.
Additionally, a multithreading environment or interrupt events may cause extra delays.
This commit contains the custom transmit/receive function for SPI 3-wire mode. It uses critical sections to
prevents accidental interrupt event delays, disables SPI after each frame receiving and disables SPI during
frame generation. It adds some delay between SPI frames (~700 ns), but gives reliable 3-wire SPI communications.
- move a code that waits readable SPI state from `spi_master_write`
function to inline functions `msp_writable` and `msp_wait_writable`
- move a code that waits writeable SPI state from `spi_master_write`
function to inline functions `msp_readable` and `msp_wait_readable`
- move a code that writes data to SPI from `spi_master_write`
function to inline function `msp_write_data`
- move a code that reads data from SPI from `spi_master_write`
function to inline function `msp_read_data`
This commit enables the Overriding of HAL callbacks and IRQHandler
in stm32xx_emac.cpp. Hence the user can have their own
implementations of callbacks and IRQHandler functions.
Signed-off-by: Kather Rafi Ibrahim <katherrafi.i@hcl.com>
As per STM32H7-series reference manuals:
"Up to 64 filter elements can be configured for 29-bit extended IDs."
This commit fixes a bug which prevented receiving CAN-messages
with extended IDs.
We weren't setting the "supported_application_profiles" correctly for
some baremetal supported targets. This didn't cause build failures with
mbed-cli 1 as it just seems to ignore this config parameter. In our CMake
build system we have added a hard dependency on the
supported_application_profiles; we fail the build if the profile we're
trying to build isn't in the list.
We were previously relying on the global MBED_PATH variable to provide
the root for the include path to the post build hooks. We can't
guarantee that MBED_PATH will be set by any application building us, so
use CMAKE_MODULE_PATH (which we always set) like we do for the other
post-build hooks.
This commit adds internal pullup on DP line for usb enumeration
in nucleo_l152re platform. This platform as such does not have
usb connector (device).
This has been tested with example in https://github.com/ARMmbed/
mbed-os/blob/master/drivers/usb/include/usb/USBMouse.h#L58-L76
and mbed_app.json file
"target_overrides": {
"*": {
"platform.stdio-baud-rate": 115200,
"platform.all-stats-enabled": true,
"mbed-trace.enable": "0"
},
"NUCLEO_L152RE": {
"target.device_has_add": ["USBDEVICE"]
}
}
}
Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
1. Change from single image boot to multiple image boot
2. SDH is configured to Secure for placing update firmware. It becomes inaccessible to Mbed.
3. Post-build script supports both multiple image boot and single image boot
4. Update readme to reflect above change
5. Increase forced_reset_timeout due to longer booting time for Greentea test
The CMake macro `mbed_post_build_psoc6_merge_hex()` takes the name of
a Cypress target and an optional Cortex-M0 hex image as arguments. The
proper way to define and parse optional arguments of a function or
macro is `cmake_parse_arguments()`, which allows the caller to
indicate what they are passing rather than rely on an argument's
relative position within `${ARGN}` which is not rigorous.
Also, avoid duplicating the common part of the post build command
when the optional argument is passed/not passed.
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.
This commit modifies readme file. Descption for using
I2C timing algorithm and how to enable and disable
included.
Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
This commit solves issue related to i2c driver performance.
With this commit delay in read write when using i2c timing
algorithm is solved. Used flag mechanism which will check
tim reg value and hz passed.
Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
The multiple InterruptIn object with same pin_index sharing same IRQ line.
So the second object will overwrite the first one. To catch this as error,
implemented an error catching functionality.
This commit updates the documentation on how to use
mbed_otp_mac_address() to modify the default MAC address to custom
Mac address.
Signed-off-by: Kather Rafi Ibrahim <katherrafi.i@hcl.com>
Fix pin names of K64F with the following from the latest guidelines:
* LEDs and buttons are defined as macros, digital and analog pins as
enums.
* No duplicated pin names with the same value.
* The Arduino form factor is deprecated in favour of Arduino Uno.
Note: The pins `SPI_xxx` are for SD card only, but the names are kept
for backward compatibility (i.e. no breaking change until the next
Mbed OS major version). The general purpose Arduino Uno SPI pins
(`ARDUINO_UNO_SPI_xxx`) are different and also available.
This commit solves excess usage of RAM. User can now enable/disable
I2C timing algorithm. Disabling of I2C timing algorithm would
reduce RAM usage.
Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
For `MCU_M2354`, the use of `device_has` in `targets.json` overrides the devices
present in the base target: `PSA_V8_M`. In particular, `DEVICE_TRNG` is missing
in `NU_M2354` builds as `TRNG` is a member of the `PSA_V8_M` `device_has` list.
As suggested by @ccli8, to ensure that `PSA_V8_M` devices are inherited by
derived targets, such as `MCU_M2354`, the correct syntax to use is
`device_has_add`.
Modified i2c_device.h file. This will solve I2C read
write long time issue. Updated default I2C peripheral clock
value to 160MHz.
fix:
ARMmbed/mbed-os#14732
Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
1. Build TF-M v1.3 with GNUARM and HXT not present.
2. Support configurability of HXT presence (targets.json).
3. Default HXT to not present (targets.json). This must align with built TF-M secure code above.
Modified print_adc function to update adc pin_map.
This patch will update python script that generate
'peripheralPin.c'. Which will give functionality to
gernerate ADC pin definition for BANK_B.
This script update is related to
https://github.com/ARMmbed/mbed-os/pull/14669
Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
LXT/HXT are external crystl oscillator and can be absent on custom board.
This enables configuring LXT/HXT presence:
1. By default, LXT/HXT are configured to be present, except M252 which has no HXT.
2. When LXT is configured to not present, lp_ticker/watchdog will clock by LIRC instead.
3. Limitations:
(1) On all targets, LIRC-clocked lp_ticker gets inaccurate and fails to pass tests.
(2) On NUC472/M453, HIRC-clocked PLL doesn't output 1MHz-aligned frequency. us_ticker gets slight inaccurate.
(3) On all targets, LIRC-clocked RTC is not supported due to no H/W path/RTC clock source reset to LXT on reset/RTC not trimmed for other clock rates.
4. On M263, TRNG's clock source defaults to LXT and needs special handling without LXT.
5. On M252, replace target.hxt-enable with target.hxt-present for consistency.
Modified HAL_I2C_ErrorCallback function to solve bug reported in I2C Driver.
This commit solves compilation error occured when DEVICE_I2CSLAVE is not defined.
fix#14696
Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>