完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
开机
$KARMARMCCbinfromelf.exe --bin --output=.out bin@L.bin !L
/******************************************************************************** * @file main.c * @author jianqiang.xue * @Version V1.0.0 * @Date 2021-04-03 * @brief ********************************************************************************/ #include #include "cx32l003_hal.h" #include "bsp_system_clock.h" #include "bsp_key.h" #include "bsp_uart.h" #include "business_gpio.h" #define APP_TARGET_ADDR (BS_FLASH_BOOT_SIZE + BS_FLASH_USER_INFO_SIZE) typedef void (*p_func)(void); p_func jump_app; uint32_t jump_addr; void hardware_init(void) { /* Configure the system clock to HIRC 24MHz*/ bsp_system_clock_config(); bsp_button_init(); bsp_uart_init(); } /* * main: initialize and start the system */ int main(void) { hardware_init(); printf("runrn"); if (bsp_button_get_state(BSP_BUTTON_0) == 0) { boot: printf("bootrn"); } else { HAL_NVIC_DisableIRQ(UART0_IRQn); bsp_uart0_deinit(); bsp_button_deinit(BSP_BUTTON_0); if (((*(__IO uint32_t*)APP_TARGET_ADDR) & 0x2FFE0000 ) == 0x20000000) { /* jump to user application */ jump_addr = *(__IO uint32_t*) (APP_TARGET_ADDR + 4); jump_app = (p_func) jump_addr; /* initialize user application's stack pointer */ __set_PSP(*(__IO uint32_t*) APP_TARGET_ADDR); __set_CONTROL(0); __set_MSP(*(__IO uint32_t*) APP_TARGET_ADDR); jump_app(); } goto boot; } while(1); } APP
$KARMARMCCbinfromelf.exe --bin --output=.outbin@L.bin !L
/******************************************************************************** * @file main.c * @author jianqiang.xue * @Version V1.0.0 * @Date 2021-04-03 * @brief ********************************************************************************/ #include #include "os_api.h" #include "bsp_system_clock.h" #include "bsp_led.h" #include "bsp_key.h" #include "bsp_adc.h" #include "bsp_i2c.h" #include "bsp_uart.h" #include "app_key.h" #include "business_function.h" extern uint8_t app_main_init(void); void hardware_init(void) { /* Configure the system clock to HIRC 24MHz*/ bsp_system_clock_config(); bsp_led_init(); bsp_button_init(); bsp_adc0_init(); bsp_i2c_init(); bsp_uart_init(); } /* * main: initialize and start the system */ int main(void) { hardware_init(); os_kernel_initialize(); app_key_init(); app_main_init(); os_kernel_start(); }
#define VECT_TAB_OFFSET (0)改: #define VECT_TAB_OFFSET (BS_FLASH_BOOT_SIZE + BS_FLASH_USER_INFO_SIZE) |
|
|
|
只有小组成员才能发言,加入小组>>
3269 浏览 9 评论
2947 浏览 16 评论
3446 浏览 1 评论
8967 浏览 16 评论
4041 浏览 18 评论
1084浏览 3评论
562浏览 2评论
const uint16_t Tab[10]={0}; const uint16_t *p; p = Tab;//报错是怎么回事?
556浏览 2评论
用NUC131单片机UART3作为打印口,但printf没有输出东西是什么原因?
2294浏览 2评论
NUC980DK61YC启动随机性出现Err-DDR是为什么?
1850浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-13 15:04 , Processed in 1.086943 second(s), Total 79, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号