Mbed TLS on lpc55s69

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Mbed TLS on lpc55s69

2,271 次查看
beze
Contributor II

Hello,

I got a LPC55S69 with TrustZone. Currently i try to build an application that runs in secure world and reads memory from normal world and calculates a sha-2 hash of this values. For the hash I am looking for a libary that supports sha-2. From some research I found out that the board has hardware support for hash calculation but I could not find any guidance on how to use this. The examples come with mbed tls (a libary that has sha-2). If anyone had the same issues before and could tell me how to use this hardware for hashing or how to include the mbed tls libary to my mcuxpresso project I would be really thankful.

Thanks and best regards,
Lukas 

0 项奖励
回复
2 回复数

2,228 次查看
beze
Contributor II

Hello,
first of all thanks for your help. I followed every step and now have mbed tls on the trustzone hello world s example. Hash calculation works fine as long as i do not use the hardware accerleration. But i want to use the hardware accelerator as in the mbed tls examples. So I configured everything like in the example but always get the same error when building the project. Did anyone have the same issue or does know how I can fix the problem.

Thanks and best regards,
Lukas

 

Output when building:

arm-none-eabi-gcc -nostdlib -L"D:\UniStuff\Bachelor Arbeit\Code\Attestation\lpcxpresso55s69_hello_world_s\libs" -Xlinker -Map="lpcxpresso55s69_hello_world_s.map" -Xlinker --gc-sections -Xlinker -print-memory-usage -Xlinker --sort-section=alignment -Xlinker --cref -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -T lpcxpresso55s69_hello_world_s_Debug.ld -Xlinker --out-implib="lpcxpresso55s69_hello_world_s_CMSE_lib.o" -Xlinker --cmse-implib -o "lpcxpresso55s69_hello_world_s.axf" ./utilities/fsl_assert.o ./utilities/fsl_debug_console.o ./utilities/fsl_str.o ./trustzone/tzm_config.o ./trustzone/veneer_table.o ./startup/boot_multicore_slave.o ./startup/startup_lpc55s69_cm33_core0.o ./source/hello_world_s.o ./source/semihost_hardfault.o ./drivers/fsl_casper.o ./drivers/fsl_clock.o ./drivers/fsl_common.o ./drivers/fsl_flexcomm.o ./drivers/fsl_gpio.o ./drivers/fsl_hashcrypt.o ./drivers/fsl_power.o ./drivers/fsl_reset.o ./drivers/fsl_usart.o ./device/system_LPC55S69_cm33_core0.o ./component/uart/usart_adapter.o ./component/serial_manager/serial_manager.o ./component/serial_manager/serial_port_uart.o ./component/lists/generic_list.o ./board/board.o ./board/clock_config.o ./board/pin_mux.o -lpower_hardabi_s -lpower_hardabi
Memory region Used Size Region Size %age Used
PROGRAM_FLASH: 14076 B 65024 B 21.65%
SG_veneer_table: 32 B 512 B 6.25%
d:/mcuxpressoide_11.2.0_4120/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.2.0.202001021529/tools/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: ./source/hello_world_s.o: in function `main':
D:\UniStuff\Bachelor Arbeit\Code\Attestation\lpcxpresso55s69_hello_world_s\Debug/../source/hello_world_s.c:163: undefined reference to `CRYPTO_InitHardware'
Ram0: 4376 B 32 KB 13.35%
d:/mcuxpressoide_11.2.0_4120/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.2.0.202001021529/tools/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: D:\UniStuff\Bachelor Arbeit\Code\Attestation\lpcxpresso55s69_hello_world_s\Debug/../source/hello_world_s.c:173: undefined reference to `mbedtls_sha256'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:41: lpcxpresso55s69_hello_world_s.axf] Error 1
"make -r -j8 all" terminated with exit code 2. Build might be incomplete.

0 项奖励
回复

2,247 次查看
nxf63973
NXP Employee
NXP Employee

Hi Lukas

When building the MCUXpresso SDK package for the LPC55s69 at the MCUXpresso Builder, you can add some middleware, including Mbed Crypto and mbedtls. Please look at the image attached, be sure that you mark the box with the middleware that you want.

304722_1.png

Once you import this SDK package to MCUXpresso IDE you can include these software components creating a new project and select them in the window Configure the Project.

304722_2.png

Also, you can import the examples provided with these libraries, by using the tool Import SDK example(s)… from the Quickstart Panel.  For a better reference take a look at the guide: MCUXpresso IDE - Importing MCUXpresso SDK

304722_3.png

Best regards,

Jose

0 项奖励
回复