M2354: Fix stdin abnormal on NuMaker-IoT-M2354 with Mbed CLI

Due to post-build script not supporting custom board, both the below UART configurations are enabled on NuMaker-IoT-M2354 board:
-   UART0 PA7/PA6 enabled by bl2.bin
-   UART0 PB9/PB8 enabled by tfm_s.bin and later by mbed
Both PA7/PA6 and PB9/PB8 enabled on UART0, PB8 gets disturbed and stdin mis-behaves on NuMaker-IoT-M2354 board.

NuMaker-M2354       : UART TX/RX = UART0 PA7/PA6
NuMaker-IoT_M2354   : UART TX/RX = UART0 PB9/PB8

This bugfix tries to enable post-build for custom board to some degree (not completely), with Mbed CLI.
NOTE: For Mbed CLI, the build process still sees NuMaker-M2354's partition/ and applies its mcuboot build options. Custom board must align on these.
pull/15140/head
Chun-Chieh Li 2021-10-13 17:57:56 +08:00
parent 3167a1fd5d
commit 173e407fed
1 changed files with 2 additions and 1 deletions

View File

@ -27,7 +27,6 @@ from datetime import datetime
SCRIPT_DIR = dirname(abspath(__file__)) SCRIPT_DIR = dirname(abspath(__file__))
MBED_OS_ROOT = abspath(path_join(SCRIPT_DIR, os.pardir, os.pardir)) MBED_OS_ROOT = abspath(path_join(SCRIPT_DIR, os.pardir, os.pardir))
SECURE_ROOT = path_join(MBED_OS_ROOT, 'targets', 'TARGET_NUVOTON', 'TARGET_M2354', 'TARGET_TFM', 'TARGET_NU_M2354', 'COMPONENT_TFM_S_FW')
def m2354_tfm_bin(t_self, non_secure_image, secure_bin): def m2354_tfm_bin(t_self, non_secure_image, secure_bin):
@ -37,6 +36,8 @@ def m2354_tfm_bin(t_self, non_secure_image, secure_bin):
secure_bin = abspath(secure_bin) secure_bin = abspath(secure_bin)
non_secure_image = abspath(non_secure_image) non_secure_image = abspath(non_secure_image)
SECURE_ROOT = dirname(secure_bin)
build_dir = dirname(non_secure_image) build_dir = dirname(non_secure_image)
tempdir = path_join(build_dir, 'temp') tempdir = path_join(build_dir, 'temp')
if not isdir(tempdir): if not isdir(tempdir):