Commit Graph

8656 Commits (e8dd9f43fac63b1765931a28e2170e436208b982)

Author SHA1 Message Date
Chun-Chieh Li e8dd9f43fa M467: Make mbedtls H/W port removable
Some M460 chips don't support AES/SHA/ECC/RSA H/W.
Make them removable from mbedtls H/W port through '"target.macros_remove": ["MBEDTLS_CONFIG_HW_SUPPORT"]'.
2022-09-01 10:02:19 +08:00
cyliangtw 2f8b60d501 M467: support fullspeed usb device 2022-09-01 10:02:19 +08:00
Chun-Chieh Li 88a529180f M467: Support Crypto RSA H/W
1.  Crypto RSA H/W supports 1024/2048/3072/4096 key bits. Fall back to software implementation for other key bits.
2.  For decrypt, if MBEDTLS_RSA_NO_CRT isn't defined, go CRT, or normal.
3.  For decrypt, when blinding (f_rng != NULL), enable SCAP mode.
4.  Recover from Crypto RSA H/W failure:
    (1) Enable timed-out wait to escape from RSA H/W trap
    (2) On RSA H/W timeout, stop this RSA H/W operation
    (3) Fall back to S/W implementation on failure

NOTE: RSA 4096 key bits can fail with default mbedtls configuration MBEDTLS_MPI_MAX_SIZE.
      Enlarge MBEDTLS_MPI_MAX_SIZE to 1024 or larger if this feature is required.
NOTE: Fixed in BSP RSA driver, for non-CRT+SCAP mode, temporary buffer for MADDR6 requires to be key length plus 128 bits.
NOTE: Fixed in BSP RSA driver, DMA buffer must be 4-word aligned, or RSA H/W will trap.
2022-09-01 10:02:18 +08:00
Chun-Chieh Li 21970e30f1 M467: Seed PRNG with TRNG for SCAP
According to TRM, it is suggested PRNG be seeded by TRNG on every Crypto H/W reset.
2022-09-01 10:02:17 +08:00
Chun-Chieh Li d92d75e9ac M467: Improve Crypto H/W wait helper routine
Add crypto_xxx_wait2 helper routine to replace crypto_xxx_wait for Crypto H/W control
2022-09-01 10:02:17 +08:00
Chun-Chieh Li 24b0feb17f M467: Support Crypto SHA/ECC H/W
1.  Prepare crypto common code
2.  Support list
    -   SHA
    -   ECC
    NOTE: AES/RSA are to support in other works
    NOTE: Compared to M487, M467's SHA supports context save & restore (DMA Cascade mode) and so no software fallback is needed.
    NOTE: M467's ECC, following M487, goes partial-module replacement and it can just improve primitives e.g. point addition/doubling by 2X,
          and cannot improve high level point multiplication because MbedTLS doesn’t open it.
          To improve performance best, full-module replacement is needed.
    NOTE: Continuing above, add support for Montgomery curve
2022-09-01 10:02:16 +08:00
cyliangtw 501aa00fa0 Config for M460 EMAC 2022-09-01 10:02:15 +08:00
Chun-Chieh Li 0494866f5f M467: Support HyperRAM
1.  For GCC, support multi-block .data/.bss initialization
2.  HyperRAM is mapped to two regions: 0x0A000000 and 0x80000000
    According to default system address map, 0x0A000000 is located at 'Code' region and 0x80000000 at 'RAM' region.
    With MPU enabled on Mbed OS, 'Code' region is write-never and 'RAM' region execute-never.
    0x80000000 is chosen because 'RAM' regioin is naturally for HyperRAM.
3.  Configurable multi-function pins for HBI
4.  To locate code/data at external HyperRAM:
    -   Specify __attribute__((section(".text.nu.exthyperram"))) for RO/.text/readonly section type
        Invoke mbed_mpu_manager_lock_ram_execution()/mbed_mpu_manager_unlock_ram_execution() to run HyperRAM code
    -   Specify __attribute__((section(".data.nu.exthyperram"))) for RW/.data/readwrite section type
    -   Specify __attribute__((section(".bss.nu.exthyperram"))) for ZI/.bss/zeroinit section type
5.  Add readme
2022-09-01 10:02:15 +08:00
Chun-Chieh Li 8da2e31336 M467: Fix Greentea reset_reason test failure
HRESETRF is combined reset flag. Filter it out to avoid interference with reset reason check.
2022-09-01 10:02:15 +08:00
Chun-Chieh Li df77485f02 Support Nuvoton target NUMAKER_IOT_M467
1.  Based on alpha version BSP (85564a2716548e7b6d6a79a490c6d94a24cf9bcf)
2.  Continuing above, tweak BSP:
    (1) Add EPWM_ConfigOutputChannel2() to enable below 1Hz and below 1% duty cycle for PWM output (m460_epwm.h/c).
    (2) Add dummy RTC_WaitAccessEnable() for consistency with previous ports (m460_rtc.h).
3.  Target NuMaker-M467HJ V0.1 board temporarily
4.  Support Arduino UNO form factor for NUMAKER_IOT_M467 target
5.  Enable export to Keil/IAR project
    -   tools/arm_pack_manager/index.json
    -   tools/export/iar/iar_definitions.json
2022-09-01 10:02:14 +08:00
Deepak V. Shreshti 61e5a61e34 Removed UTF-8 Chars 2022-08-24 18:31:42 +05:30
Deepak V. Shreshti adadcf3171 Updated System file and Scatter file 2022-08-23 18:26:51 +05:30
Henrik Persson 684181c40b Add targets.json definition for STM32F412xE 2022-06-20 17:09:02 +02:00
Henrik Persson bdaa4a457d Make STM32F412xE targets build
Trying to inherit the STM32F412xE target makes the linker fail, since
__CRASH_DATA_RAM_START__ is not present. Comparing LD scripts with the
STM32F412xG (which has active targets) it seems that the xE variant has
missed some updates somewhere. Since the LD scripts are otherwise
identical, copying the (working) ones from STM32F412xG seems to do the
trick.

Also added flash_data.h which was missing and needed here and there
(copied from xG and updated to fit the xE flash layout).
2022-06-16 16:05:34 +02:00
Jason Reiss 4d616ccc70 MTS002: update MTS_MDOT_F411RE usb clock setting for 8MHz output 2022-06-08 08:42:22 -05:00
Jason Reiss 0905a2e672 MTS001 - add custom clock configuration for MTS_MDOT_F411RE to use 26MHz XTAL 2022-06-08 08:42:22 -05:00
Martin Kojtal 1ab98dec9a
Merge pull request #15286 from pilotak/master
STM32G4: Fix serial port at low speed baud
2022-05-13 14:47:44 +02:00
Pavel S 58e6bf7520
Fix serial low speed baud 2022-05-13 11:16:15 +02:00
Rami Elkhatib fdf37c3217 MPS2 CM3DS ethernet words instead of bytes
The functions smsc9220_receive_by_chunks and smsc9220_send_by_chunks are
supposed to implement receiving and sending packets by chunks. However,
the functions SMSC9220_EMAC::low_level_input and SMSC9220_EMAC::link_out,
which call them respectively, already require or assemble the full packet.
Also, smsc9220_receive_by_chunks doesn't implement the "chunks" part.

This commit renames the functions to smsc9220_receive_packet and
smsc9220_send_packet. The functions now do their operations by word
instead of by bytes. The functions SMSC9220_EMAC::low_level_input and
SMSC9220_EMAC::link_out already handle allocation, continuity and word
alignment of the packet buffer.
2022-05-12 18:27:49 -04:00
Rami Elkhatib f7aca62865 MPS2 CM3DS ethernet fix packet bug
The function smsc9220_receive_by_chunks loads data from the Ethernet port.
It is expected to return the Ethernet frame without the 4 CRC bytes.
However, it is required to call the Ethernet data port register (32-bit)
an amount equal to the number of frame words (including the 4 CRC bytes)
to pop all frame words. The current code doesn't call the register for the
last word (which has CRC data). This causes subsequent calls to have this
missed word at the beginning. The impact of this is huge as the high level
API is getting fed wrong data. The fix adds one additional call to the data
port register.
2022-05-12 18:25:15 -04:00
YahyaTawil 7a108087ed Add default SWO pin number and config if not defined in Ambiq target 2022-05-06 17:24:59 +03:00
YahyaTawil fabe70c0fc Enable ITM (SWO) tracing support to Ambiq Apollo3 targets 2022-05-05 15:47:35 +03:00
YahyaTawil 6467f77125 add ITM (SWO) tracing support to Ambiq Apollo3 targets 2022-05-05 15:45:09 +03:00
Jerome Coutant de4ea6ecd2 STM32F334xx wrong RAM size 2022-05-04 10:43:41 +02:00
Jerome Coutant 6a8a52acf6 STM32L0: add MCU_STM32L071xB support 2022-04-29 09:47:25 +02:00
Martin Kojtal 88b6bb0d85
Merge pull request #15269 from jeromecoutant/PR_G4_UART_ASYNC
STM32G4 : enable UART ASYNC
2022-04-26 11:57:21 +02:00
Jerome Coutant 1985e77dae STM32G4 : enable SERIAL_ASYNCH in default configuration 2022-04-25 16:59:41 +02:00
Jerome Coutant 9b1d4ee62e STM32G4 : add UART5 in IRQ init 2022-04-25 16:59:30 +02:00
Jerome Coutant 271ed686f3 STM32L0 : I2C2 was missing 2022-04-20 14:27:49 +02:00
Sadik.Ozer 4dd01440c4 utf-8 check
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-14 10:27:17 +03:00
Sadik.Ozer 8323e9a7f5 Fix GCC_ARM warnings
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 11:23:39 -05:00
Sadik.Ozer 2f813fcbaa Update system files and mbed wrappers
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 11:22:45 -05:00
Sadik.Ozer 7826582e44 Update LP API
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 10:41:07 -05:00
Sadik.Ozer 92983653ed Leave last page of flash
It is used by rom bootloader

Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 10:41:07 -05:00
Sadik.Ozer 24f4738f24 Provide option to user to drive SS pin too
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 10:41:06 -05:00
Sadik.Ozer f1bce7389f Provide all uart mapping
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 10:41:06 -05:00
Sadik.Ozer 65e6595d7b Fix rtc read issue
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 10:41:05 -05:00
Sadik.Ozer 8a2681bf6e Add peripheral driver files
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 10:41:05 -05:00
Sadik.Ozer 704bfc786a Add peripheral interface files
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 10:41:02 -05:00
Sadik.Ozer f40887acdd Remove __R because of confliction
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 10:41:00 -05:00
Sadik.Ozer fc90e9a64e Update cmsis files
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 10:40:59 -05:00
Sadik.Ozer 028a85c0b7 Add initial version of files
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
2022-04-08 10:40:57 -05:00
Martin Kojtal ddaceccf5a
Merge pull request #15258 from Nantis-GmbH/stm32-uart-num-fix
STM32F0: Fix target codes for number of UARTs
2022-04-05 10:24:13 +02:00
Bora Özgen 9ff358724f STM32F0: Fix target codes for number of UARTs 2022-04-04 16:22:51 +02:00
Jerome Coutant 1cd6bf1399 STM32F1: add MCU_STM32F103xC support 2022-03-31 15:31:47 +02:00
Ahmet Alincak 751d0cf98b Correct heap region calculation for Maxim targets 2022-03-21 00:02:59 +03:00
Pavel S bf599a2438
STM32G4: Fix I2C timing 2022-03-16 08:32:39 +01:00
Pavel S 5c2f103b73
enable QSPI for STM32G4 2022-03-02 20:26:43 +01:00
Deepak V. Shreshti ae0fcefd17 Updated I2C pin names in PinNames.h header 2022-02-28 14:46:11 +05:30
Martin Kojtal 48b1b8ec78
Merge pull request #15221 from amcnicoll/amcnicoll/shared_uart_isr
Add ability to use multiple UARTs on STM32L0, STM32G0 when IRQ is shared
2022-02-22 10:36:28 +01:00