2009-01-18 07:49 PM
Firmware Library Compilation Errors
2011-05-17 03:59 AM
I am trying to compile the firmware library but got a lot of errors. For example:
In line 112 of stm32f10x_uart.c: identifier UART4_BASE is undefined. This is supposed to be defined in stm32f10x_map.h but it is not (other variables like UART1_BASE are defined there). In line 40 of stm32f10x_nvic.c, there is NVIC->ICER[0]. But the stucture NVIC, defined as (NVIC_TypeDef *) in stm32f10x_map.h, doesn't have ICER as a member. I am sure the library has been used by many people and shouldn't have errors like those. I must miss something pretty simple. I know I need to change some files in the application/example directory but I am not supposed (or no need) to change the files in the library? Any help will be very appreciated. Regards, Alan2011-05-17 03:59 AM
There are low, medium & high density STM32 devices - with different functions/capabilities AND there are a wide variety of package sizes. I hazard the guess that your part is pin constrained - and thus does not extend to UART4.
Always wise to mention your toolchain, ST has released 2 versions of their firmware - several toolchain vendors have released even more. It is important that your library and toolchain ''play nice.''2011-05-17 03:59 AM
Thanks for your quick reply. I am using Keil uVision. I have some other sample codes that I can compile, download to the board and run. No issues.
But I don't think the problems I am having in compiling the firmware is related to the toolchain or the chip being used. For example, for the UART4 missing definition, sure I understand there are chips that do not have UART4, but I just don't see how the library code would differentiate that, since there is nothing (like pre-processor directive) to tell whether to use the UART4 variable or not, based on the chip selection. The variable is just right there. And it is NOT defined anywhere. (But other variables such as UART1-3 ARE defined). I just don't see how the toolchain, or anything else, could resolve that problem, unless I modify the library code. The second problem I mentioned, ''struct has no such member'', is even worse. And there are a lot of problems like those. I am stuck and have no idea. So if anybody succeeded in compiling the library, could you post some words here, So I know it is my problem (well, I am sure it is). Really appreciate that.2011-05-17 03:59 AM
Hi,
can you attach your project? I can test in my environment...2011-05-17 03:59 AM
Hi,
Please add a file named ''cortexm3_macro.s'' into your project, all of the compile error disappeared. You can find this file in /FWLib/project/RVMDK/2011-05-17 03:59 AM
Thanks!
The project is attached. Basically I put the library under the project directory. I used the USART/Printf example. The README file in the example has detail information on how to set up the project and I just followed that. I didn't change any file. But when I compiled, I got a whole bunch of errors.2011-05-17 03:59 AM
@jason-
Good job! Thank you. (please ''close the loop'' on your earlier - GPIO to 16b ADC (lsb) issue)2011-05-17 03:59 AM