forked from wolfSSL/wolfssl
Merge pull request #1696 from quinnmiller1997/crossworks
Updated Rowley-Crossworks settings for CMSIS 4, added support for Jenkins testing
This commit is contained in:
@ -13,12 +13,11 @@ This is a sample test application. It runs "wolfcrypt_test" suite suite repeated
|
|||||||
|
|
||||||
# Prerequisits
|
# Prerequisits
|
||||||
|
|
||||||
You will need to install the "Freescale Kinetis CPU Support Package" in the
|
+You will need to install the "Freescale Kinetis CPU Support Package" and "ARM CPU Support Package" in the Rowley Package Manager under Tools -> Pacakge Manager.
|
||||||
Rowley Package Manager under Tools -> Pacakge Manager.
|
|
||||||
|
|
||||||
# Harware Support
|
# Harware Support
|
||||||
|
|
||||||
All hardware functions are defined in `kinetis_hw.c` and are currently setup for a Freescale Kinetis K64 Coretx-M4 microcontroller. This file can be customized to work with other Kinetis microcontrollers by editing the top part of the file. Testing for this project was done with the Freescale Kinetis `MK64FN1M0xxx12` using the `TWR-K64F120M`.
|
All hardware functions are defined in `kinetis_hw.c` and are currently setup for a Freescale Kinetis K64 Coretx-M4 microcontroller. This file can be customized to work with other Kinetis microcontrollers by editing the top part of the file. Testing for this project was done with the Freescale Kinetis `MK64FN1M0xxx12` using the `TWR-K64F120M`. To build for the `TWR-K64F120M` or `FRDM-K64F`, define `WOLFSSL_FRDM_K64` in the Preprocessor Definitions section of CrossStudio, or define it in "user_settings.h".
|
||||||
|
|
||||||
To create support for a new ARM microcontroller the functions in `hw.h` will need to be implemented.
|
To create support for a new ARM microcontroller the functions in `hw.h` will need to be implemented.
|
||||||
|
|
||||||
|
@ -44,6 +44,14 @@ void main(void)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
/* Used for testing, must have a delay so no data is missed while serial is initializing */
|
||||||
|
#ifdef WOLFSSL_FRDM_K64_JENKINS
|
||||||
|
if(test_num == 2){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
delay_us(1000000);
|
||||||
|
#endif
|
||||||
|
|
||||||
printf("\nBenchmark Test %d:\n", test_num);
|
printf("\nBenchmark Test %d:\n", test_num);
|
||||||
benchmark_test(&args);
|
benchmark_test(&args);
|
||||||
printf("Benchmark Test %d: Return code %d\n", test_num, args.return_code);
|
printf("Benchmark Test %d: Return code %d\n", test_num, args.return_code);
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
// $(TargetsDir) location:
|
// $(TargetsDir) location:
|
||||||
// On Mac OS/X: Users/USERNAME/Library/Rowley Associates Limited/CrossWorks for ARM/packages/targets/
|
// On Mac OS/X: Users/USERNAME/Library/Rowley Associates Limited/CrossWorks for ARM/packages/targets/
|
||||||
// On Windows: C:/Users/USERNAME/Application Data/Local/Rowley Associates Limited/CrossWorks for ARM/packages/targets/
|
// On Windows: C:/Users/USERNAME/Application Data/Local/Rowley Associates Limited/CrossWorks for ARM/packages/targets/
|
||||||
|
// On Linux: home/USERNAME/.rowley_associates_limited/CrossWorks for ARM/v4/packages/targets/
|
||||||
|
|
||||||
// Located in $(TargetsDir)/Kinetis/CMSIS/
|
// Located in $(TargetsDir)/Kinetis/CMSIS/
|
||||||
#ifdef FREESCALE_KSDK_BM
|
#ifdef FREESCALE_KSDK_BM
|
||||||
@ -67,17 +68,29 @@
|
|||||||
#define UART_TX_PORT PORTA /* UART TX Port */
|
#define UART_TX_PORT PORTA /* UART TX Port */
|
||||||
#define UART_TX_PIN 2U /* UART TX Pin */
|
#define UART_TX_PIN 2U /* UART TX Pin */
|
||||||
#define UART_TX_MUX kPORT_MuxAlt2 /* Kinetis UART pin mux */
|
#define UART_TX_MUX kPORT_MuxAlt2 /* Kinetis UART pin mux */
|
||||||
|
#elif defined (WOLFSSL_FRDM_K64)
|
||||||
|
#define UART_PORT UART0 /* UART Port */
|
||||||
|
#define UART_TX_PORT PORTB /* UART TX Port */
|
||||||
|
#define UART_TX_PIN 17U /* UART TX Pin */
|
||||||
|
#define UART_TX_MUX 0x3 /* Kinetis UART pin mux */
|
||||||
#else
|
#else
|
||||||
#define UART_PORT UART4 /* UART Port */
|
#define UART_PORT UART4 /* UART Port */
|
||||||
#define UART_TX_PORT PORTE /* UART TX Port */
|
#define UART_TX_PORT PORTE /* UART TX Port */
|
||||||
#define UART_TX_PIN 24U /* UART TX Pin */
|
#define UART_TX_PIN 24U /* UART TX Pin */
|
||||||
#define UART_TX_MUX 0x3 /* Kinetis UART pin mux */
|
#define UART_TX_MUX 0x3 /* Kinetis UART pin mux */
|
||||||
#endif
|
#endif
|
||||||
#define UART_BAUD 115200 /* UART Baud Rate */
|
#define UART_BAUD_RATE 115200 /* UART Baud Rate */
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_FRDM_K64
|
||||||
|
#define UART_BAUD UART_BAUD_RATE*8
|
||||||
|
#else
|
||||||
|
#define UART_BAUD UART_BAUD_RATE
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Note: You will also need to update the UART clock gate in hw_uart_init (SIM_SCGC1_UART5_MASK) */
|
/* Note: You will also need to update the UART clock gate in hw_uart_init (SIM_SCGC1_UART5_MASK) */
|
||||||
/* Note: TWR-K60 is UART3, PTC17 */
|
/* Note: TWR-K60 is UART3, PTC17 */
|
||||||
/* Note: FRDM-K64 is UART4, PTE24 */
|
/* Note: FRDM-K64 is UART4, PTE24 */
|
||||||
|
/* Note: FRDM-K64 is UART4, PTE24 or UART0 PTB17 for OpenOCD (SIM_SCGC4_UART0_MASK)*/
|
||||||
/* Note: TWR-K64 is UART5, PTE8 */
|
/* Note: TWR-K64 is UART5, PTE8 */
|
||||||
/* Note: FRDM-K82F is LPUART0 A2, LPUART4 PTC15 */
|
/* Note: FRDM-K82F is LPUART0 A2, LPUART4 PTC15 */
|
||||||
|
|
||||||
@ -130,6 +143,13 @@ static void hw_gpio_init(void)
|
|||||||
| SIM_SCGC5_PORTE_MASK
|
| SIM_SCGC5_PORTE_MASK
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#if 0 /* Debug clock */
|
||||||
|
/* ClockOut on PTC3 */
|
||||||
|
PORTC->PCR[3] = PORT_PCR_MUX(0x05); /* Alt 5 */
|
||||||
|
SIM_SOPT2 |= SIM_SOPT2_CLKOUTSEL(0); /* FlexBus CLKOUT */
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,10 +163,14 @@ static void hw_uart_init(void)
|
|||||||
CLOCK_SetLpuartClock(1); /* MCGPLLCLK */
|
CLOCK_SetLpuartClock(1); /* MCGPLLCLK */
|
||||||
DbgConsole_Init((uint32_t)UART_PORT, UART_BAUD, DEBUG_CONSOLE_DEVICE_TYPE_LPUART, SYS_CLK_HZ);
|
DbgConsole_Init((uint32_t)UART_PORT, UART_BAUD, DEBUG_CONSOLE_DEVICE_TYPE_LPUART, SYS_CLK_HZ);
|
||||||
#else
|
#else
|
||||||
/* Enable UART core clock */
|
#ifdef WOLFSSL_FRDM_K64
|
||||||
/* Note: Remember to update me if UART_PORT changes */
|
/* Enable UART core clock ONLY for FRDM-K64F */
|
||||||
SIM->SCGC1 |= SIM_SCGC1_UART4_MASK;
|
SIM->SCGC4 |= SIM_SCGC4_UART0_MASK;
|
||||||
|
#else
|
||||||
|
/* Enable UART core clock */
|
||||||
|
/* Note: Remember to update me if UART_PORT changes */
|
||||||
|
SIM->SCGC1 |= SIM_SCGC1_UART4_MASK;
|
||||||
|
#endif
|
||||||
/* Configure UART TX pin */
|
/* Configure UART TX pin */
|
||||||
UART_TX_PORT->PCR[UART_TX_PIN] = PORT_PCR_MUX(UART_TX_MUX);
|
UART_TX_PORT->PCR[UART_TX_PIN] = PORT_PCR_MUX(UART_TX_MUX);
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <wolfssl/wolfcrypt/settings.h>
|
#include <wolfssl/wolfcrypt/settings.h>
|
||||||
#include <wolfcrypt/test/test.h>
|
#include <wolfcrypt/test/test.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "hw.h"
|
||||||
|
|
||||||
typedef struct func_args {
|
typedef struct func_args {
|
||||||
int argc;
|
int argc;
|
||||||
@ -44,12 +45,28 @@ void main(void)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
/* Used for testing, must have a delay so no data is missed while serial is initializing */
|
||||||
|
#ifdef WOLFSSL_FRDM_K64_JENKINS
|
||||||
|
/* run twice */
|
||||||
|
if(test_num == 2){
|
||||||
|
printf("\n&&&&&&&&&&&&& done &&&&&&&&&&&&&&&");
|
||||||
|
delay_us(1000000);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
delay_us(1000000); /* 1 second */
|
||||||
|
#endif
|
||||||
|
|
||||||
printf("\nCrypt Test %d:\n", test_num);
|
printf("\nCrypt Test %d:\n", test_num);
|
||||||
wolfcrypt_test(&args);
|
wolfcrypt_test(&args);
|
||||||
printf("Crypt Test %d: Return code %d\n", test_num, args.return_code);
|
printf("Crypt Test %d: Return code %d\n", test_num, args.return_code);
|
||||||
|
|
||||||
test_num++;
|
test_num++;
|
||||||
} while(args.return_code == 0);
|
} while(args.return_code == 0);
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_FRDM_K64_JENKINS
|
||||||
|
printf("\n&&&&&&&&&&&&&& done &&&&&&&&&&&&&\n");
|
||||||
|
delay_us(1000000);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@
|
|||||||
arm_target_loader_applicable_loaders="Flash"
|
arm_target_loader_applicable_loaders="Flash"
|
||||||
arm_target_loader_default_loader="Flash"
|
arm_target_loader_default_loader="Flash"
|
||||||
c_preprocessor_definitions="WOLFSSL_ROWLEY_ARM;WOLFSSL_USER_SETTINGS"
|
c_preprocessor_definitions="WOLFSSL_ROWLEY_ARM;WOLFSSL_USER_SETTINGS"
|
||||||
c_user_include_directories=".;../;../../;$(TargetsDir);$(TargetsDir)/Kinetis;$(TargetsDir)/Kinetis/CMSIS;$(TargetsDir)/Kinetis/CMSIS/include;$(TargetsDir)/CMSIS_3/CMSIS/include"
|
c_user_include_directories=".;../;../../;$(TargetsDir);$(TargetsDir)/Kinetis;$(TargetsDir)/Kinetis/CMSIS;$(TargetsDir)/Kinetis/CMSIS/include;$(TargetsDir)/CMSIS_4/CMSIS/include;$(TargetsDir)/../CMSIS_4/CMSIS;$(TargetsDir)/../CMSIS_4/CMSIS/Include"
|
||||||
debug_register_definition_file="$(TargetsDir)/Kinetis/MK64F12_Peripherals.xml"
|
debug_register_definition_file="$(TargetsDir)/Kinetis/MK64F12_Peripherals.xml"
|
||||||
linker_memory_map_file="$(TargetsDir)/Kinetis/MK64FN1M0xxx12_MemoryMap.xml"
|
linker_memory_map_file="$(TargetsDir)/Kinetis/MK64FN1M0xxx12_MemoryMap.xml"
|
||||||
linker_memory_map_macros="FLASHSIZE=0x80000;SRAMSIZE=0x20000"
|
linker_memory_map_macros="FLASHSIZE=0x80000;SRAMSIZE=0x20000"
|
||||||
@ -201,7 +201,7 @@
|
|||||||
arm_target_loader_applicable_loaders="Flash"
|
arm_target_loader_applicable_loaders="Flash"
|
||||||
arm_target_loader_default_loader="Flash"
|
arm_target_loader_default_loader="Flash"
|
||||||
c_preprocessor_definitions="WOLFSSL_ROWLEY_ARM;WOLFSSL_USER_SETTINGS"
|
c_preprocessor_definitions="WOLFSSL_ROWLEY_ARM;WOLFSSL_USER_SETTINGS"
|
||||||
c_user_include_directories=".;../;../../;$(TargetsDir);$(TargetsDir)/Kinetis;$(TargetsDir)/Kinetis/CMSIS;$(TargetsDir)/Kinetis/CMSIS/include;$(TargetsDir)/CMSIS_3/CMSIS/include"
|
c_user_include_directories=".;../;../../;$(TargetsDir);$(TargetsDir)/Kinetis;$(TargetsDir)/Kinetis/CMSIS;$(TargetsDir)/Kinetis/CMSIS/include;$(TargetsDir)/CMSIS_4/CMSIS/include;$(TargetsDir)/../CMSIS_4/CMSIS;$(TargetsDir)/../CMSIS_4/CMSIS/Include"
|
||||||
debug_register_definition_file="$(TargetsDir)/Kinetis/MK64F12_Peripherals.xml"
|
debug_register_definition_file="$(TargetsDir)/Kinetis/MK64F12_Peripherals.xml"
|
||||||
linker_memory_map_file="$(TargetsDir)/Kinetis/MK64FN1M0xxx12_MemoryMap.xml"
|
linker_memory_map_file="$(TargetsDir)/Kinetis/MK64FN1M0xxx12_MemoryMap.xml"
|
||||||
linker_memory_map_macros="FLASHSIZE=0x80000;SRAMSIZE=0x20000"
|
linker_memory_map_macros="FLASHSIZE=0x80000;SRAMSIZE=0x20000"
|
||||||
|
Reference in New Issue
Block a user