diff --git a/Makefile.am b/Makefile.am index 0c5b7c3bc..d2a99cfae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -77,7 +77,7 @@ include testsuite/include.am include tests/include.am include sslSniffer/sslSnifferTest/include.am include rpm/include.am -include mqx/ctaocrypt_test/Sources/include.am +include mqx/wolfcrypt_test/Sources/include.am include mqx/cyassl/include.am include mqx/cyassl_client/Sources/include.am include mqx/util_lib/Sources/include.am diff --git a/mqx/ctaocrypt_test/.cproject b/mqx/ctaocrypt_test/.cproject deleted file mode 100644 index 6a742b34d..000000000 --- a/mqx/ctaocrypt_test/.cproject +++ /dev/null @@ -1,2542 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mqx/ctaocrypt_test/.project b/mqx/ctaocrypt_test/.project deleted file mode 100644 index 82a85749d..000000000 --- a/mqx/ctaocrypt_test/.project +++ /dev/null @@ -1,98 +0,0 @@ - - - ctaocrypt_test - - - -cyassl - -util_lib - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.buildArguments - -j6 - - - org.eclipse.cdt.make.core.buildCommand - ${system:ECLIPSE_HOME}/../gnu/bin/mingw32-make - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath}/twrk70f120m_Int_Flash_SramData_Debug - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Sources/ctaocrypt-test - 2 - PARENT-2-PROJECT_LOC/ctaocrypt/test - - - - - 1351803045734 - Sources/ctaocrypt-test - 5 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-true-(.*?)\.(c)$ - - - - - - MQX_ROOT_DIR - file:/C:/Freescale/Freescale%20MQX%203.8 - - - diff --git a/mqx/ctaocrypt_test/ReferencedRSESystems.xml b/mqx/ctaocrypt_test/ReferencedRSESystems.xml deleted file mode 100644 index 3df5e1711..000000000 --- a/mqx/ctaocrypt_test/ReferencedRSESystems.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mqx/ctaocrypt_test/Sources/include.am b/mqx/ctaocrypt_test/Sources/include.am deleted file mode 100644 index b167955e2..000000000 --- a/mqx/ctaocrypt_test/Sources/include.am +++ /dev/null @@ -1,15 +0,0 @@ -# vim:ft=automake -# All paths should be given relative to the root -# - -EXTRA_DIST += \ - mqx/ctaocrypt_test/.cproject \ - mqx/ctaocrypt_test/.project \ - mqx/ctaocrypt_test/ReferencedRSESystems.xml \ - mqx/ctaocrypt_test/ctaocrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE_U-MultiLink.launch \ - mqx/ctaocrypt_test/ctaocrypt_test_twrk70f120m_Int_Flash_SramData_Release_PnE_U-MultiLink.launch - -EXTRA_DIST += \ - mqx/ctaocrypt_test/Sources/main.c \ - mqx/ctaocrypt_test/Sources/main.h - diff --git a/mqx/ctaocrypt_test/Sources/main.c b/mqx/ctaocrypt_test/Sources/main.c deleted file mode 100644 index bb3304320..000000000 --- a/mqx/ctaocrypt_test/Sources/main.c +++ /dev/null @@ -1,103 +0,0 @@ -/* main.c */ - -#include "main.h" - -/* SD card open/close utility functions */ -#include "util.h" - -#if !BSPCFG_ENABLE_IO_SUBSYSTEM -#error This application requires BSPCFG_ENABLE_IO_SUBSYSTEM defined \ - non-zero in user_config.h. Please recompile BSP with this option. -#endif - -#ifndef BSP_DEFAULT_IO_CHANNEL_DEFINED -#error This application requires BSP_DEFAULT_IO_CHANNEL to be not NULL. \ - Please set corresponding BSPCFG_ENABLE_TTYx to non-zero in \ - user_config.h and recompile BSP with this option. -#endif - - -TASK_TEMPLATE_STRUCT MQX_template_list[] = -{ -/* Task number, Entry point, Stack, Pri, String, Auto? */ - {MAIN_TASK, Main_task, 20000, 9, "main", MQX_AUTO_START_TASK}, - {0, 0, 0, 0, 0, 0, } -}; - -/*TASK*----------------------------------------------------- -* -* Task Name : Main_task -* Comments : -* This task opens the SD card device and runs the -* CTaoCrypt test functions located in test.c. -* -*END*-----------------------------------------------------*/ - -#if defined BSP_SDCARD_ESDHC_CHANNEL - #if ! BSPCFG_ENABLE_ESDHC - #error This application requires BSPCFG_ENABLE_ESDHC defined \ - non-zero in user_config.h. Please recompile libraries with \ - this option. - #endif - -#elif defined BSP_SDCARD_SDHC_CHANNEL - #if ! BSPCFG_ENABLE_SDHC - #error This application requires BSPCFG_ENABLE_SDHC defined \ - non-zero in user_config.h. Please recompile libraries with \ - this option. - #endif -#endif - -#if defined (BSP_SDCARD_SPI_CHANNEL) - #define SDCARD_COM_CHANNEL BSP_SDCARD_SPI_CHANNEL -#elif defined (BSP_SDCARD_ESDHC_CHANNEL) - #define SDCARD_COM_CHANNEL BSP_SDCARD_ESDHC_CHANNEL -#elif defined (BSP_SDCARD_SDHC_CHANNEL) - #define SDCARD_COM_CHANNEL BSP_SDCARD_SDHC_CHANNEL -#else - #error "SDCARD low level communication device not defined!" -#endif - -/* func_args from test.h */ -typedef struct func_args { - int argc; - char** argv; - int return_code; -} func_args; - -void Main_task(uint_32 initial_data) -{ - int ret = 0; - func_args args; - _mqx_int error_code, bytes; - _mqx_uint sz; - char filesystem_name[] = "a:"; - char partman_name[] = "pm:"; - MQX_FILE_PTR com_handle, sdcard_handle, filesystem_handle, partman_handle; - MQX_FILE_PTR cert_file = NULL; - const char* fileName = "a:\certs\\client-key.der"; - - ret = sdcard_open(&com_handle, &sdcard_handle, &partman_handle, - &filesystem_handle, partman_name, filesystem_name); - - if (ret != 0) { - printf("error: sdcard_open(), ret = %d\n", ret); - _mqx_exit(1); - } - printf("SD card installed to %s\n", filesystem_name); - - ctaocrypt_test(&args); - - ret = sdcard_close(&sdcard_handle, &partman_handle, - &filesystem_handle, partman_name, filesystem_name); - - if (ret != 0) { - printf("error: sdcard_close(), ret = %d\n", ret); - _mqx_exit(1); - } - printf("SD card uninstalled.\n"); - - _mqx_exit(0); -} - -/* EOF */ diff --git a/mqx/wolfcrypt_test/.cproject b/mqx/wolfcrypt_test/.cproject new file mode 100644 index 000000000..ac76a6284 --- /dev/null +++ b/mqx/wolfcrypt_test/.cproject @@ -0,0 +1,681 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mqx/wolfcrypt_test/.project b/mqx/wolfcrypt_test/.project new file mode 100644 index 000000000..a782a6817 --- /dev/null +++ b/mqx/wolfcrypt_test/.project @@ -0,0 +1,42 @@ + + + wolfcrypt_test + + + +cyassl + +util_lib + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + Sources/test + 2 + PARENT-2-PROJECT_LOC/ctaocrypt/test + + + + + MQX_ROOT_DIR + file:/C:/Freescale/Freescale_MQX_4_1 + + + diff --git a/mqx/wolfcrypt_test/Debugger/K70FN1M0.mem b/mqx/wolfcrypt_test/Debugger/K70FN1M0.mem new file mode 100755 index 000000000..7da747bce --- /dev/null +++ b/mqx/wolfcrypt_test/Debugger/K70FN1M0.mem @@ -0,0 +1,43 @@ +// Memory Configuration File +// +// Description: +// A memory configuration file contains commands that define the legally accessible +// areas of memory for your specific board. Useful for example when the debugger +// tries to display the content of a "char *" variable, that has not yet been initialized. +// In this case the debugger may try to read from a bogus address, which could cause a +// bus error. +// +// Board: +// Kinetis K70FN1M0 +// +// Reference: +// - + + +// All reserved ranges read back 0xBABA... +reservedchar 0xBA + +usederivative "MK70F15" + +// Memory Map: +// ---------------------------------------------------------------------- + +range 0x00000000 0x000FFFFF 4 ReadWrite // 1024KB Code Flash +reserved 0x00100000 0x13FFFFFF +range 0x14000000 0x14003FFF 4 ReadWrite // 16KB Programming accelleration RAM +reserved 0x14004000 0x1FFEFFFF +range 0x1FFF0000 0x1FFFFFFF 4 ReadWrite // 64KB On chip SRAM (TCML) +range 0x20000000 0x2000FFFF 4 ReadWrite // 64KB On chip SRAM (TCMU) +reserved 0x20010000 0x21FFFFFF +range 0x22000000 0x221FFFFF 4 ReadWrite // Aliased to TCMU SRAM bitband +reserved 0x22200000 0x3FFFFFFF +reserved 0x60000000 0x6FFFFFFF // Flexbus for external memory +range 0x70000000 0x7FFFFFFF 4 ReadWrite // DRAM Controller - Write-back +range 0x80000000 0x8FFFFFFF 4 ReadWrite // DRAM Controller - Write-through +reserved 0x90000000 0xDFFFFFFF // Flexbus for external memory +reserved 0xE0100000 0xFFFFFFFF + +// Comment the following line for NFC-projects +reserved 0x400A8000 0x400ABEFF +// Uncomment the following line for NFC-projects +//range 0x400A8000 0x400ABEFF 4 ReadWrite diff --git a/mqx/wolfcrypt_test/Debugger/init_kinetis.tcl b/mqx/wolfcrypt_test/Debugger/init_kinetis.tcl new file mode 100755 index 000000000..467b8ff9f --- /dev/null +++ b/mqx/wolfcrypt_test/Debugger/init_kinetis.tcl @@ -0,0 +1,71 @@ +# this method initializes debug modules which are not affected by software reset +# register names should be referenced including the register group name to improve performance + +proc init_debug_modules {} { + # initialize LR to avoid invalid stack after reset + reg "User\\/System Mode Registers/LR" = 0xFFFFFFFF + + # clear DWT function registers + reg "Core Debug Registers/DEMCR" = 0x1000001 + reg "Data Watchpoint and Trace Unit Registers/DWT_FUNCTION0" = 0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_FUNCTION1" = 0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_FUNCTION2" = 0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_FUNCTION3" = 0x0 + # clear FPB comparators + reg "Flash Patch and Breakpoint Unit Registers/FP_COMP0" = 0x0 + reg "Flash Patch and Breakpoint Unit Registers/FP_COMP1" = 0x0 + reg "Flash Patch and Breakpoint Unit Registers/FP_COMP2" = 0x0 + reg "Flash Patch and Breakpoint Unit Registers/FP_COMP3" = 0x0 + reg "Flash Patch and Breakpoint Unit Registers/FP_COMP4" = 0x0 + reg "Flash Patch and Breakpoint Unit Registers/FP_COMP5" = 0x0 +} + +proc init_trace_modules {} { + # clear DWT registers + reg "Data Watchpoint and Trace Unit Registers/DWT_CTRL" =0x40000000 + reg "Data Watchpoint and Trace Unit Registers/DWT_CYCCNT" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_CPICNT" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_EXCCNT" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_SLEEPCNT" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_LSUCNT" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_FOLDCNT" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_COMP0" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_COMP1" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_COMP2" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_COMP3" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_MASK0" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_MASK1" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_MASK2" =0x0 + reg "Data Watchpoint and Trace Unit Registers/DWT_MASK3" =0x0 + # clear ITM registers + reg "Instrumentation Trace Macrocell Registers/ITM_LAR" =0xc5acce55 + reg "Instrumentation Trace Macrocell Registers/ITM_TER" =0x0 + reg "Instrumentation Trace Macrocell Registers/ITM_TPR" =0x0 + reg "Instrumentation Trace Macrocell Registers/ITM_TCR" =0x0 + reg "Instrumentation Trace Macrocell Registers/ITM_LAR" =0x1 + # reset Funnel registers + reg "Embedded Trace Funnel Registers/ETF_FCR" =0x300 + # clear MCM registers + reg "Core Platform Miscellaneous Control Module (MCM) Registers/MCM_ETBCC" =0x0 + reg "Core Platform Miscellaneous Control Module (MCM) Registers/MCM_ETBRL" =0x0 + # set SCB_VTOR register for RAM + reg "System Control Registers/SCB_VTOR" =0x20000000 +} + +proc envsetup {} { + # Environment Setup + radix x + config hexprefix 0x + config MemIdentifier p + config MemWidth 32 + config MemAccess 32 + config MemSwap off +} + +#------------------------------------------------------------------------------- +# Main +#------------------------------------------------------------------------------- + + envsetup + init_debug_modules + init_trace_modules diff --git a/mqx/wolfcrypt_test/Debugger/mass_erase_kinetis.tcl b/mqx/wolfcrypt_test/Debugger/mass_erase_kinetis.tcl new file mode 100755 index 000000000..2d8b84054 --- /dev/null +++ b/mqx/wolfcrypt_test/Debugger/mass_erase_kinetis.tcl @@ -0,0 +1,31 @@ +# This script performs the mass erase operation for Kinetis targets + +# Command mass erase with system reset and core reset +set mdmapControl [cmdwin::reg MDMAP_C -np] +set mdmapControl [expr $mdmapControl | 0x19] +cmdwin::reg MDMAP_C = $mdmapControl + +# Release system reset while still holding core reset +set mdmapControl [expr $mdmapControl & 0xFFFFFFF7] +cmdwin::reg MDMAP_C = $mdmapControl + +# Wait for the mass erase operation to complete +set done 0 +for {set i 0} {$i < 10} {incr i} { + refresh + set mdmapControl [cmdwin::reg MDMAP_C -np] + if {($mdmapControl & 1) == 0} { + set done 1 + break; + } + wait 50 +} + +# Release the core reset +set mdmapControl [expr $mdmapControl & 0xFFFFFFEF] +cmdwin::reg MDMAP_C = $mdmapControl +if {$done} { + puts "OK: Mass erase succeeded" +} else { + puts "Error: Timeout" +} \ No newline at end of file diff --git a/mqx/wolfcrypt_test/ReferencedRSESystems.xml b/mqx/wolfcrypt_test/ReferencedRSESystems.xml new file mode 100644 index 000000000..bd244eef0 --- /dev/null +++ b/mqx/wolfcrypt_test/ReferencedRSESystems.xml @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mqx/wolfcrypt_test/Sources/include.am b/mqx/wolfcrypt_test/Sources/include.am new file mode 100644 index 000000000..93c807a89 --- /dev/null +++ b/mqx/wolfcrypt_test/Sources/include.am @@ -0,0 +1,22 @@ +# vim:ft=automake +# All paths should be given relative to the root +# + +EXTRA_DIST += \ + mqx/wolfcrypt_test/.cproject \ + mqx/wolfcrypt_test/.project \ + mqx/wolfcrypt_test/Debugger/K70FN1M0.mem \ + mqx/wolfcrypt_test/Debugger/init_kinetis.tcl \ + mqx/wolfcrypt_test/Debugger/mass_erase_kinetis.tcl \ + mqx/wolfcrypt_test/ReferencedRSESystems.xml \ + mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_DDRData_Debug_PnE U-MultiLink.launch \ + mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_DDRData_Release_PnE U-MultiLink.launch \ + mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_JTrace.jlink \ + mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_JTrace.launch \ + mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE U-MultiLink.launch \ + mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Release_PnE U-MultiLink.launch + +EXTRA_DIST += \ + mqx/wolfcrypt_test/Sources/main.c \ + mqx/wolfcrypt_test/Sources/main.h + diff --git a/mqx/wolfcrypt_test/Sources/main.c b/mqx/wolfcrypt_test/Sources/main.c new file mode 100644 index 000000000..39e9cd8a5 --- /dev/null +++ b/mqx/wolfcrypt_test/Sources/main.c @@ -0,0 +1,94 @@ +/* main.c */ + +#include "main.h" + +/* SD card open/close utility functions */ +#include "util.h" + +#if !BSPCFG_ENABLE_IO_SUBSYSTEM +#error This application requires BSPCFG_ENABLE_IO_SUBSYSTEM defined \ + non-zero in user_config.h. Please recompile BSP with this option. +#endif + +#ifndef BSP_DEFAULT_IO_CHANNEL_DEFINED +#error This application requires BSP_DEFAULT_IO_CHANNEL to be not NULL. \ + Please set corresponding BSPCFG_ENABLE_TTYx to non-zero in \ + user_config.h and recompile BSP with this option. +#endif + +TASK_TEMPLATE_STRUCT MQX_template_list[] = +{ + /* Task number, Entry point, Stack, Pri, String, Auto? */ + {MAIN_TASK, Main_task, 20000, 9, "main", MQX_AUTO_START_TASK}, + {0, 0, 0, 0, 0, 0, } +}; + +#if defined BSP_SDCARD_ESDHC_CHANNEL + #if ! BSPCFG_ENABLE_ESDHC + #error This application requires BSPCFG_ENABLE_ESDHC defined \ + non-zero in user_config.h. Please recompile libraries with \ + this option. + #endif + +#elif defined BSP_SDCARD_SDHC_CHANNEL + #if ! BSPCFG_ENABLE_SDHC + #error This application requires BSPCFG_ENABLE_SDHC defined \ + non-zero in user_config.h. Please recompile libraries with \ + this option. + #endif +#endif + +#if defined (BSP_SDCARD_SPI_CHANNEL) + #define SDCARD_COM_CHANNEL BSP_SDCARD_SPI_CHANNEL +#elif defined (BSP_SDCARD_ESDHC_CHANNEL) + #define SDCARD_COM_CHANNEL BSP_SDCARD_ESDHC_CHANNEL +#elif defined (BSP_SDCARD_SDHC_CHANNEL) + #define SDCARD_COM_CHANNEL BSP_SDCARD_SDHC_CHANNEL +#else + #error "SDCARD low level communication device not defined!" +#endif + +/* func_args from test.h */ +typedef struct func_args { + int argc; + char** argv; + int return_code; +} func_args; + +/*TASK*----------------------------------------------------------------- + * Function Name : Main_task + * Comments : + * This task opens the SD card device and runs the + * CTaoCrypt test functions located in test.c. + *END------------------------------------------------------------------*/ + +void Main_task(uint32_t initial_data) +{ + int ret = 0; + func_args args; + char filesystem_name[] = "a:"; + char partman_name[] = "pm:"; + MQX_FILE_PTR com_handle, sdcard_handle, filesystem_handle, partman_handle; + + ret = sdcard_open(&com_handle, &sdcard_handle, &partman_handle, + &filesystem_handle, partman_name, filesystem_name); + if (ret != 0) { + printf("error: sdcard_open(), ret = %d\n", ret); + _mqx_exit(1); + } + printf("SD card installed to %s\n", filesystem_name); + + ctaocrypt_test(&args); + + ret = sdcard_close(&sdcard_handle, &partman_handle, + &filesystem_handle, partman_name, filesystem_name); + if (ret != 0) { + printf("error: sdcard_close(), ret = %d\n", ret); + _mqx_exit(1); + } + printf("SD card uninstalled.\n"); + + _mqx_exit(0); + +} + diff --git a/mqx/ctaocrypt_test/Sources/main.h b/mqx/wolfcrypt_test/Sources/main.h similarity index 69% rename from mqx/ctaocrypt_test/Sources/main.h rename to mqx/wolfcrypt_test/Sources/main.h index 2ea7c9133..ca1f58d27 100644 --- a/mqx/ctaocrypt_test/Sources/main.h +++ b/mqx/wolfcrypt_test/Sources/main.h @@ -5,17 +5,16 @@ #include #include - -#include #include +#include #include -#include #include #include -#define MAIN_TASK 1 +#define MAIN_TASK 1 -extern void Main_task(uint_32); +extern void Main_task (uint32_t); +void ctaocrypt_test(void* args); #endif /* __main_h_ */ diff --git a/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_DDRData_Debug_PnE U-MultiLink.launch b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_DDRData_Debug_PnE U-MultiLink.launch new file mode 100644 index 000000000..bc7fd451b --- /dev/null +++ b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_DDRData_Debug_PnE U-MultiLink.launch @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_DDRData_Release_PnE U-MultiLink.launch b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_DDRData_Release_PnE U-MultiLink.launch new file mode 100644 index 000000000..9217d72fa --- /dev/null +++ b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_DDRData_Release_PnE U-MultiLink.launch @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_JTrace.jlink b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_JTrace.jlink new file mode 100644 index 000000000..f40a58f1c --- /dev/null +++ b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_JTrace.jlink @@ -0,0 +1,34 @@ +[BREAKPOINTS] +ShowInfoWin = 1 +EnableFlashBP = 2 +BPDuringExecution = 0 +[CFI] +CFISize = 0x00 +CFIAddr = 0x00 +[CPU] +OverrideMemMap = 0 +AllowSimulation = 1 +ScriptFile="" +[FLASH] +CacheExcludeSize = 0x00 +CacheExcludeAddr = 0x00 +MinNumBytesFlashDL = 0 +SkipProgOnCRCMatch = 1 +VerifyDownload = 1 +AllowCaching = 1 +EnableFlashDL = 2 +Override = 0 +Device="UNSPECIFIED" +[GENERAL] +WorkRAMSize = 0x00 +WorkRAMAddr = 0x00 +RAMUsageLimit = 0x00 +[SWO] +SWOLogFile="" +[MEM] +RdOverrideOrMask = 0x00 +RdOverrideAndMask = 0xFFFFFFFF +RdOverrideAddr = 0xFFFFFFFF +WrOverrideOrMask = 0x00 +WrOverrideAndMask = 0xFFFFFFFF +WrOverrideAddr = 0xFFFFFFFF diff --git a/mqx/ctaocrypt_test/ctaocrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE_U-MultiLink.launch b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_JTrace.launch similarity index 81% rename from mqx/ctaocrypt_test/ctaocrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE_U-MultiLink.launch rename to mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_JTrace.launch index 6c74d9ae1..2cc81ce38 100644 --- a/mqx/ctaocrypt_test/ctaocrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE_U-MultiLink.launch +++ b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_JTrace.launch @@ -1,162 +1,182 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE U-MultiLink.launch~Stashed changes b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE U-MultiLink.launch~Stashed changes new file mode 100644 index 000000000..2cc81ce38 --- /dev/null +++ b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE U-MultiLink.launch~Stashed changes @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE U-MultiLink.launch~Updated upstream b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE U-MultiLink.launch~Updated upstream new file mode 100644 index 000000000..2cc81ce38 --- /dev/null +++ b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE U-MultiLink.launch~Updated upstream @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mqx/ctaocrypt_test/ctaocrypt_test_twrk70f120m_Int_Flash_SramData_Release_PnE_U-MultiLink.launch b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Release_PnE U-MultiLink.launch similarity index 87% rename from mqx/ctaocrypt_test/ctaocrypt_test_twrk70f120m_Int_Flash_SramData_Release_PnE_U-MultiLink.launch rename to mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Release_PnE U-MultiLink.launch index 8a56e79c0..d089c2435 100644 --- a/mqx/ctaocrypt_test/ctaocrypt_test_twrk70f120m_Int_Flash_SramData_Release_PnE_U-MultiLink.launch +++ b/mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Release_PnE U-MultiLink.launch @@ -1,158 +1,168 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +