58 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			58 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
|  | /****************************************************************************
 | ||
|  | 
 | ||
|  | Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED. | ||
|  | 
 | ||
|  | This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT | ||
|  | be copied by any method or incorporated into another program without | ||
|  | the express written consent of Aerospace C.Power. This Information or any portion | ||
|  | thereof remains the property of Aerospace C.Power. The Information contained herein | ||
|  | is believed to be accurate and Aerospace C.Power assumes no responsibility or | ||
|  | liability for its use in any way and conveys no license or title under | ||
|  | any patent or copyright and makes no representation or warranty that this | ||
|  | Information is free from patent or copyright infringement. | ||
|  | 
 | ||
|  | ****************************************************************************/ | ||
|  | /* os shim includes */ | ||
|  | #include "os_types.h"
 | ||
|  | #include "os_mem.h"
 | ||
|  | #include "iot_config.h"
 | ||
|  | #include "sec_cpu_utils.h"
 | ||
|  | #include "sec_cpu_timer.h"
 | ||
|  | #include "sec_cpu_fsm.h"
 | ||
|  | #include "sec_cpu_phy_isr.h"
 | ||
|  | 
 | ||
|  | /* mbedtls: 8k, crypto dsa: 2k */ | ||
|  | #define SEC_CPU_ALLOC_MEM_SZ        ((8 + 2) * 1024)
 | ||
|  | 
 | ||
|  | static uint8_t g_sec_cpu_alloc_mem[SEC_CPU_ALLOC_MEM_SZ] = { 0 }; | ||
|  | 
 | ||
|  | uint8_t g_sec_cpu_run_state = 0; | ||
|  | 
 | ||
|  | void iot_module_init(void) | ||
|  | { | ||
|  |     sec_cpu_timer_sys_init(); | ||
|  |     /* init alloc mem */ | ||
|  |     os_mem_init(g_sec_cpu_alloc_mem, sizeof(g_sec_cpu_alloc_mem)); | ||
|  | } | ||
|  | 
 | ||
|  | int main(void) | ||
|  | { | ||
|  |     iot_module_init(); | ||
|  | 
 | ||
|  |     sec_cpu_printf("sec_cpu start\n"); | ||
|  | 
 | ||
|  |     sec_cpu_fsm_init(); | ||
|  | 
 | ||
|  |     g_sec_cpu_run_state = 1; | ||
|  | 
 | ||
|  |     sec_cpu_phy_isr_init(); | ||
|  | 
 | ||
|  |     sec_cpu_fsm_main(); | ||
|  | 
 | ||
|  |     sec_cpu_printf("sec_cpu error !!!\n"); | ||
|  | 
 | ||
|  |     while (1); | ||
|  | 
 | ||
|  |     return 0; | ||
|  | } |