23441 views|1 replies

121

Posts

1

Resources
The OP
 

LPC1768 UCOSII is ported to IAR8.3 environment. There is no problem in compiling, but it is stuck when creating the first task function... [Copy link]

Previously, the program was run in the KEIL5 environment and there was no problem; Now I have changed to the IAR8.30 environment, configured and compiled, and there are 3 warnings, as shown in black below; Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement Because this is variable-related, it is not processed //system_LPC17xx.c file void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */ { /* Determine clock frequency according to clock register values */ if (((LPC_SC->PLL0STAT >> 24) & 3) == 3) { /* If PLL0 enabled and connected */ switch (LPC_SC->CLKSRCSEL & 0x03) { case 0: /* Int. RC oscillator => PLL0 */ case 3: /* Reserved, default to Int. RC */ SystemCoreClock = (IRC_OSC * ((2 * ((LPC_SC->PLL0STAT & 0x7FFF) + 1))) / (((LPC_SC->PLL0STAT >> 16) & 0xFF) + 1) / ((LPC_SC->CCLKCFG & 0xFF)+ 1)); break; case 1: /* Main oscillator => PLL0 */ SystemCoreClock = (OSC_CLK * ((2 * ((LPC_SC->PLL0STAT & 0x7FFF) + 1))) / (((LPC_SC->PLL0STAT >> 16) & 0xFF) + 1) / ((LPC_SC->CCLKCFG & 0xFF)+ 1)); break; case 2: /* RTC osci llator => PLL0 */ SystemCoreClock = (RTC_CLK * ((2 * ((LPC_SC->PLL0STAT & 0x7FFF) + 1))) / (((LPC_SC->PLL0STAT >> 16) & 0xFF) + 1) / ((LPC_SC->CCLKCFG & 0xFF)+ 1)); break; } } else { switch ( LPC_SC->CLKSRCSEL & 0x03) { case 0: /* Int. RC oscillator => PLL0 */ case 3: /* Reserved, default to Int. RC */ SystemCoreClock = IRC_OSC / ((LPC_SC->CCLKCFG & 0xFF)+ 1); break; case 1: /* Main oscillator => PLL0 */ SystemCoreClock = OSC_CLK / ((LPC_SC->CCLKCFG & 0xFF)+ 1); break; case 2: /* RTC oscillator => PLL0 */ SystemCoreClock = RTC_CLK / ((LPC_SC->CCLKCFG & 0xFF)+ 1); break; } } //---------------------------------------------------------------------------------- After downloading and running, there is no problem in the initialization at the beginning, but it gets stuck every time it runs to the black mark below int main(void) { BSP_Init (); BSP_Start (); OSInit(); Timer0_Init(); OSTaskCreate(LEDON, (void *)0, &stkLEDON[sizeof(stkLEDON)/4-1], 5); OSTaskCreate(LEDOFF,(void *)0, &stkLEDOFF[sizeof(stkLEDOFF)/4-1], 4); OSStart(); } Stuck at the black mark below //startup_LPC177x_8x.s file PUBWEAK HardFault_Handler SECTION .text:CODE:NOROOT:REORDER(1) HardFault_Handler B HardFault_Handle There are the following prompts: Fri Dec 28, 2018 17:15:45: A precise data access error has occurred (CFSR.PRECISERR, BFAR) at data address 0x40034000.
This post is from Embedded System

Latest reply

yet
There is a problem with the variable setting.  Details Published on 2019-1-8 10:12

224

Posts

0

Resources
2
 
There is a problem with the variable setting.
This post is from Embedded System
 
Personal signature爱好拍砖打假
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list