iar

How can I compile two version of my code in IAR Embbedded Workbench

╄→гoц情女王★ 提交于 2019-12-25 11:57:10
问题 I have two version of code and I need to switch them as work need to compile each one while keeping two version on an IAR project. I find something like "compile switch" but I don't know how is it doing. Is there anyone tell me a keyword or an advice that can I search? 回答1: You can use C preprocessor #define feature to toggle between code versions and use IAR EWARM project's Defined Symbols feature to enable a list of #defines in a specific header file (for example: defines.h) that will be

How to disable/enable interrupts on a stm32f107 chip?

你说的曾经没有我的故事 提交于 2019-12-24 14:14:35
问题 I have an ARM stm32f107 chip. I'm porting a project from IAR to GCC IAR provides the following functions to enable and disable interrupts: #define __disable_interrupt() ... #define __enable_interrupt() ... How do I enable / disable interrupt for my chip using GCC? 回答1: I can't answer for ARM but the same function in Coldfire boils down to setting/clearing the Interrupt Priority Level masking register in the CPU. Setting it to the highest number disables/ignores all but non-maskable, setting

IAR define memory region for custom data

血红的双手。 提交于 2019-12-24 11:28:05
问题 I want to define a specific memory region in the STM32 micro where to store some strings. I'm using IAR compiler but I don't find a simple example that can help me to create the region in the correct way using the icf file. How can I create the region and use this region in the code? Thanks 回答1: I found this solution: In the icf file I define the memory region in this way: define region LANGUAGE_region = mem:[from 0x080FB000 to 0x080FC000]; "LANGUAGE_PLACE":place at start of LANGUAGE_region {

GCC Inline Assembly to IAR Inline Assembly

纵然是瞬间 提交于 2019-12-24 07:46:37
问题 I am attempting to use BeRTOS for a Texas Instruments Stellaris Cortex-M3. My work environment is IAR. There were a lot of minor changes to accommodate IAR and the specific uC that I am using but I've got one that I can't seem to solve... and frankly it's a bit over my head. This bit of code: 1 void NAKED lm3s_busyWait(unsigned long iterations) 2 { 3 register uint32_t __n __asm("r0") = iterations; 4 5 __asm volatile ( 6 "1: subs r0, #1\n\t" 7 "bne 1b\n\t" 8 "bx lr\n\t" 9 : : "r"(__n) :

IAR project variable like $PROJ_DIR$

断了今生、忘了曾经 提交于 2019-12-23 04:30:35
问题 Is there any possibility in IAR to add additional project variable like $PROJ_DIR$ to specify my project environment? I like to keep my project portable and adaptable. 回答1: As a caution, if you are IarBuild.exe to build from the command line, the workspace or global values set from "Configure Custom Arguments Variables" are not included in the project files (.ewp) and thus is not expanded by IarBuild.exe at build time. This is not an issue if you only use the IDE to build. 回答2: Of course

Programing STM32 like STM8(register level GPIO )

爱⌒轻易说出口 提交于 2019-12-21 06:26:01
问题 I programmed STM8 GPIO like PD_ODR_ODR4 = 1; but stm32f10x.h doesn't have this function.Is there any .h file that has definition for bits. Sorry but I don't know how to explain this problem better. I tried multiple GPIO libraries. strong text 回答1: You mention stm32f10x.h in the question, so I'm assuming it's about the STM32F1 series of controllers. Other series have some differences, but the general procedure is the same. GPIO pins are arranged in banks of 16 called ports, each having it's

Programing STM32 like STM8(register level GPIO )

隐身守侯 提交于 2019-12-21 06:25:20
问题 I programmed STM8 GPIO like PD_ODR_ODR4 = 1; but stm32f10x.h doesn't have this function.Is there any .h file that has definition for bits. Sorry but I don't know how to explain this problem better. I tried multiple GPIO libraries. strong text 回答1: You mention stm32f10x.h in the question, so I'm assuming it's about the STM32F1 series of controllers. Other series have some differences, but the general procedure is the same. GPIO pins are arranged in banks of 16 called ports, each having it's

ARM Data Abort error exception debugging

别等时光非礼了梦想. 提交于 2019-12-21 05:11:27
问题 So now I understand that I'm getting a ARM Data Abort exception - I see how to trap the exception itself (a bad address in the STL library), but I would like to walk back up the stack frame before the exception. I'm using the IAR toolchain, and it tells me the call stack is unavailable after the exception - is there a trick way to convince the tool to show me the call stack? Thanks for all the quick help! 回答1: if you look at the ARM ARM (ARM Architecture Reference Manual, just google "arm arm

Embedded C: Registers Access

我怕爱的太早我们不能终老 提交于 2019-12-13 13:16:07
问题 Suppose we want to write at address say 0xc000 , we can define a macro in C as: #define LCDCW1_ADDR 0xc000 #define READ_LCDCW1() (*(volatile uint32_t *)LCDCW1_ADDR) #define WRITE_LCDCW1(val) ((*(volatile uint32_t *)LCDCW1_ADDR) = (val)) My question is that when using any micro-controller, consider an example MSP430, P1OUT register address is 0x0021. But when we use P1OUT=0xFFFF; // it assigns P1OUT a value 0xFFFF. My question is how does it write to that address e.g. in this case 0x0021. The

Has anyone implemented __getzone() for IAR Embedded Workbench for MSP430?

梦想的初衷 提交于 2019-12-12 20:00:05
问题 I am having to deal with some time conversions in my application. I would like to stick to using standard library functions as much as possible. Right now I am using a time_t structure as my system time base. However, some devices can sync time to my device, and that time may or may not be UTC. Also, my device will sync time to another device and that time WILL always be UTC. Anyway, I can ask the user what the time zone is of the time that is being synced to my device and whether or not they