2016-05-13 03:56 AM
Hi to all,
I am using Keil and it works fine, but I would like to try STM32F4xx series, so I would like to change compiler. I tried both EmIDE and CooCox, but I am not able to obatin a working executable. I realized a working program on Keil (a simple led blinker) and it works. The same code on the other two compilers doesnt'work. Here is what I got after compilation: Keil: Code=976 RO-data=216 RW-data=12 ZI-data=1636 EmIDE: Output size is 8.62 KB CooCox: Text=1868 Data=1084 BSS=36 Dec=2988 Does someone use EmIDE or CooCox? How do you configure them? Is it a GCC problem? Thank you Freya2016-06-17 11:00 AM
Attached are the files I built from the project last month
What are you using to flash the files? Have you considered investing in a debug-pod? You mentioned an F4 originally but the code was for an F0 (STM32F072?). Any specific board we might be familiar with? DISCO? ________________ Attachments : demo.hex : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hti4&d=%2Fa%2F0X0000000aW2%2FxHybp1yUjsxEUs0sDxfHAkbMRYTRoRomSKoaR0EYPd4&asPdf=falsedemo.map : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtdL&d=%2Fa%2F0X0000000aSA%2F.9rhZUSUtgGaVW0yXw4zAPYzdO_C8AerjSdOpGpP7ac&asPdf=falseflat.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtMO&d=%2Fa%2F0X0000000aP2%2FUcx_rpzOt5XljdHey_qcYtW8DSJy9ZJnyqUruVCF4QM&asPdf=false2016-06-20 01:51 PM
I experience always big problems in login, but today I am succesfull, so I can answer :)
I tried files you compiled, but also them would not work. I used an STM32F030K6 (32 pin LQFP) for my board and I am using FlashLoaderDemonstrator to transfer files. I use also a STM32F0308-DISCO board for comparison, but I have not yet understood how to use it for debugging (IDEs I used did not recognized it) I annex files for the DISCO version. Now I am trying to write startup code in C instead of assembler hoping to reduce fault causes. If I understood well, all code is loaded in flash memory starting from address 0x00000000 (in order: isr_vectors, code, data, bss). Then starts Reset_Handler routine that copy data from flash to ram and, at last jump to SystemInit() and main(). Probably this will be a blind alley, but I have nothing to lose in trying. I would like also to debug my code line by line, but I have not yet understood how. Freya ________________ Attachments : Src.7z : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HteE&d=%2Fa%2F0X0000000aSD%2FQ02MQJhUBbkfBNKVii8wZC670Sg0ilquIsgC3S5M8cs&asPdf=false2016-06-20 08:26 PM
Your startup code is not calling the constructors.
2016-06-21 12:11 PM
Hi,
you are right, now I corrected both startup.s and startup.c, but result is always the same. Checking .map file I noted differences in .isr_vectors between .map file and .hex file. For example Reset_handler: .map -> 0x0800040c .hex -> 08001DD9 SysTick_Handler: .map -> 0x08000224 .hex -> 080003D1 Is it right? ________________ Attachments : gcc.7z : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzM7&d=%2Fa%2F0X0000000bNH%2FK63_URHOUwJJzi7KHzueHH8n1JUVENx7NzsW73eCpow&asPdf=false2016-06-21 01:38 PM
I had built a version for the DISCO, and run the LED init code explicitly, and the main loop had them flashing alternately.
2016-06-21 05:01 PM
Attached should be working DISCO and alternate board examples.
________________ Attachments : demo_alt.hex : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtiJ&d=%2Fa%2F0X0000000aW5%2FqkhjDRGRJWr8SMEYMN2PlI0Om.3fPnNlbsTDD2MRQ3s&asPdf=falsedemo_disco.hex : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtiT&d=%2Fa%2F0X0000000aW6%2F9KSnMNBks7.ejjhSzv4Oz1.cUGSyw620Pl4D7Z1iFw4&asPdf=false2016-06-21 11:46 PM
Hi Clive,
I tried the disco version and it worked fine. Please, could you tell me which startup file and which gcc version did you use? I suppose you ran the bat.bat file included in the zip file. Did you make some changes? Thnak you Freya2016-06-22 10:08 AM
I'm using GNU/GCC 4.9, a flat file structure and a makefile. Building your original code, cleaned up a bit so I can build for GPIOA vs GPIOC, and explicitly initializing the LED.
Sorry not much of a CPP fan, but was apparent constructors/ctors stuff wasn't getting done.2016-06-22 12:58 PM
I'm using version 5.3. I'll try with another gcc version.
What do you mean with: ''was apparent constructors/ctors stuff wasn't getting done.''? Do I have to cut some sections? Now I'll try and post when I'll get results. Thank you Freya2016-06-22 10:07 PM
> I'm using version 5.3. I'll try with another gcc version.
> What do you mean with: ''was apparent constructors/ctors stuff wasn't getting done.''?
For C++, the startup code additionally calls all constructors for class objects (not created by 'new') before it jumps to main. That happens right after stack setup and memory initialization. Thus, you need a special startup code for C++ programs, the 'standard' C startup will not do. Changing the gcc version is probably not going to help.