This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Hi,
To test encryption/decryption, I created a new SMEK using "gen_keywr_cert.sh -g".
I used that SMEK to build "hello_world" and created "hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang.appimage.hs".
I wanted to start the created appimage with SBL UART and check that the appimage failed to start, but an error occurred while running "uart_bootloader.py".
I was expecting an error in the bootloader, but is this the correct process?
Did I do something wrong?
1. Create a key to make decryption fail
gen_keywr_cert.sh -g
2. Convert smek.key to smek.txt
xxd -p -c 10000 smek.key | tr -d $'\n' > smek.txt
3. Edit devconfig.mk
#CUST_MEK=$(SIGNING_TOOL_PATH)/custMek_am64x_am243x.txt
CUST_MEK=$(SIGNING_TOOL_PATH)/smek.txt
4. Build hello_world
5. Boot with SBL UART
C:\ti\mcu_plus_sdk_am243x_09_02_01_05\tools\boot>python uart_bootloader.py -p COM4 --bootloader=../../../../Users/hasinoguti/workspace_v12/sbl_uart_am243x-lp_r5fss0-0_nortos_ti-arm-clang/sbl_uart.Debug.hs.tiimage --file=../../../../Users/hasinoguti/workspace_v12/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang/Debug/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang.appimage.hs
Sending the UART bootloader ../../../../Users/hasinoguti/workspace_v12/sbl_uart_am243x-lp_r5fss0-0_nortos_ti-arm-clang/sbl_uart.Debug.hs.tiimage ...
Sent bootloader ../../../../Users/hasinoguti/workspace_v12/sbl_uart_am243x-lp_r5fss0-0_nortos_ti-arm-clang/sbl_uart.Debug.hs.tiimage of size 330996 bytes in 31.0667002s.
Sending the application ../../../../Users/hasinoguti/workspace_v12/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang/Debug/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang.appimage.hs ...
Sending ../../../../Users/hasinoguti/workspace_v12/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang/Debug/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang.apSending
../../../../Users/hasinoguti/workspace_v12/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang/Debug/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang.apSending
../../../../Users/hasinoguti/workspace_v12/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang/Debug/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang.apSending
../../../../Users/hasinoguti/workspace_v12/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang/Debug/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang.apSending
../../../../Users/hasinoguti/workspace_v12/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang/Debug/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang.apSending
../../../../Users/hasinoguti/workspace_v12/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang/Debug/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang.ap
Sent application ../../../../Users/hasinoguti/workspace_v12/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang/Debug/hello_world_am243x-lp_r5fss0-0_freertos_ti-arm-clang.appimage.hs of size 104372 bytes in 10.8174202s.
[STATUS] ERROR: Application load FAILED !!!
Regards,
Yukinobu
Hi Yukinobu,
[STATUS] ERROR: Application load FAILED !!!
This error did not originate from the "uart_bootloader.py" script. Instead, the SBL_UART after receiving the appimage responded back with an error response that it failed to load the received the appimage for some reason.
Here, that reason is mostly the authentication failure.
Since, the SBL_UART receives the image over UART0, the UART logging is by default disabled in it. However, you may enable the UART logging in the SBL_UART with UART1 instance like so
Then, with the following patch, you should see the "Authentication failed" message on the MAIN_UART1 port.
diff --git a/source/drivers/bootloader/bootloader.c b/source/drivers/bootloader/bootloader.c index 3aa46db1..aad3608f 100644 --- a/source/drivers/bootloader/bootloader.c +++ b/source/drivers/bootloader/bootloader.c @@ -666,6 +666,12 @@ int32_t Bootloader_parseMultiCoreAppImage(Bootloader_Handle handle, Bootloader_B status = SystemP_SUCCESS; } + if(status == SystemP_SUCCESS) { + DebugP_log("Authentication passed\r\n"); + } else { + DebugP_log("Authentication failed\r\n"); + } + if(SystemP_SUCCESS == status) { memset(&mHdrCore[0], 0xFF, BOOTLOADER_MAX_INPUT_FILES*sizeof(Bootloader_MetaHeaderCore));
Regards,
Prashant