GunterO Posted March 17, 2015 Report Posted March 17, 2015 Hello,I'm trying to get µGFX running on bare metal while using Keil µVision 5.13.I have almost everything compiling, except 1 problem with _setjmp():.\Targets\STM32F4_Discovery\project.axf: Error: L6218E: Undefined symbol _setjmp (referred from gos_raw32.o).in gos_raw32.c this is defined:#include /* jmp_buf, setjmp(), longjmp() */#ifndef setjmp #ifndef _setjmp #define _setjmp setjmp #endif#endifsetjmp.h is coming from \Keil_v5\ARM\ARMCC\include\setjmp.hHere is already setjmp defined:#define setjmp(jmp_buf) (__CLIBNS setjmp(jmp_buf))What am I doing wrong? I have the option to comment out the #ifndef setjmp .. #endif from gos_raw32.c, then it compiles, but I don't want to mess in that code.Anybody an idea what I do best?Thanks!
inmarket Posted March 17, 2015 Report Posted March 17, 2015 I have pushed a small change to the master repository that will hopefully fix the issue with the Kiel compiler for you.Can you please try it and let me know if it works and if not then what changes are needed to make it work.
GunterO Posted March 17, 2015 Author Report Posted March 17, 2015 Not really, because setjmp is defined by Keil (\ARM\ARMCC\include\setjmp.h), so it never reaches the #define _setjmp setjmp and gos_raw32.c needs _setjmp()#if !defined(__KEIL__) && !defined(__C51__) #ifndef setjmp #ifndef _setjmp #define _setjmp setjmp #endif #endif #ifndef longjmp #ifndef _longjmp #define _longjmp longjmp #endif #endif#endifSomething like this would work better for me:#if !defined(__KEIL__) && !defined(__C51__) #if !defined(setjmp) && !defined(_setjmp) #define _setjmp setjmp #endif #if !defined(longjmp) && !defined(_longjmp) #define _longjmp longjmp #endif#else #if !defined(_setjmp) #define _setjmp setjmp #endif #if !defined(_longjmp) #define _longjmp longjmp #endif#endifSorry, but one more issue/error I forgot about...\00-uGFX\src/gos/gos_raw32.h(47): error: #256: invalid redeclaration of type name "int8_t" (declared at line 56 of "C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h")Because of this error, I commented out this (src/gos/gos_raw32.h) : typedef char int8_t;#ifndef _STDINT_H // typedef char int8_t; typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned int uint32_t;#endifThis would work:#ifndef _STDINT_H #if !defined(__KEIL__) && !defined(__C51__) typedef char int8_t; #endif typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned int uint32_t;#endifBut maybe I'm missing something?Thanks!
inmarket Posted March 17, 2015 Report Posted March 17, 2015 I will update the master with the changes to the setjmp.Thanks for that.With the int8_t, all that block should not be defined if stdint.h has been included as all those definitions should come from that file.I suspect that all the other defines are matching and so they don't give a warning whereas Keil has some funny ideas about char signed-ness (or not).A better solution is to check the top of stdint.h from Keil and change the block to be:#if !defined(_STDINT_H) && !defined( the appropriate symbol that kiel uses at the top of stdint.h ) typedef char int8_t; typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned int uint32_t;#endifCan you please get back to me on the correct symbol for that.Thanks.
inmarket Posted March 18, 2015 Report Posted March 18, 2015 I have uploaded more updates on the master repository that should fix these. Let me know if there are still any problems.
GunterO Posted March 18, 2015 Author Report Posted March 18, 2015 Well, no, sorry. I noticed it before in your comments, but the company is called Keil, not Kiel. So the definition needs to be "__KEIL__" and not "__KIEL__"
pl161187smi Posted March 31, 2015 Report Posted March 31, 2015 Hello! I new member and I try port uGFX to KEIL for use with STM32 my project build is done, but once I run debug step - mode in this line _setjmp(pframeinfo->cxt); I go to HardFault_Handler...I used source for _setjmp in this thread which provided Mr.GunterO#if !defined(__KEIL__) && !defined(__C51__) #if !defined(setjmp) && !defined(_setjmp) #define _setjmp setjmp #endif #if !defined(longjmp) && !defined(_longjmp) #define _longjmp longjmp #endif#else #if !defined(_setjmp) #define _setjmp setjmp #endif #if !defined(_longjmp) #define _longjmp longjmp #endif#endifBecause source which provided in lib "ugfx_release_22_150104" not build in Keil.I do not know what I'm doing wrong, why the code does not work (( Please help me, or if you have template project for Keil please give me for I compared in my project and find my wrong way.P.S. Sorry for my English I live in Ukraine...Thanks.
inmarket Posted April 1, 2015 Report Posted April 1, 2015 Please use the current master repository as there have been many bug fixes and changes since 2.2. This should fix your Keil compile issues as the current master is known to work with Keil.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now