Need help importing Coocox project

Sysprogs forums Forums VisualGDB Need help importing Coocox project

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #21325
    orbitcoms
    Participant

    I have 2 projects set up in Coocox 1.7.8 that I want to import into Visual Studio 2017 running latest version of VisualGDB ultimate. OS is Windows 10, 64 bit.

    Following the VisualGDB tutorial I created a new Embedded project and set up import from the coocox project folder.

    The VS project was created ok.

    I went to Properties and deselected the embedded frameworks. Also removed the VS startup project and added relative paths to all the folders I could find containing header source files in coocox project.

    However, when I do a rebuild or build, I get a large number of warnings and some errors, I have copied some warnings and errors below. Can the warnings be ignored?

    The main error seems to be the program cannot find these 2 files

    “hw_cmsis_core.h”   and  “cmsis_core.h”

    They are referred to from “hellowworld1.c” in the components/coocox-master-cmsis_core/helloworld/hellowworld

    Is this “hellowworld” file really needed? Should I just remove it

    Any help much appreciated

     

    #21328
    support
    Keymaster

    Hi,

    It looks like some include directories from the CooCox project were not imported properly.

    The easiest way to resolve this is to find the location of the missing files when compiling with CooCox. Most of the GCC-based projects use .dep files for dependency tracking – those files (generated by gcc) contain full paths of all header files included by a source file. Please try building the CooCox project and then search its build directory for .dep (or .d) files containing the names of the missing headers (e.g. hw_cmsis_core.h). If none are found, try searching in all files. Once you locate the directory of the missing files, please add them to your imported project (either via VisualGDB Project Properties or using header discovery).

    If you run into further problems, feel free to post the details here and we will help you resolve them.

    #21331
    orbitcoms
    Participant

    I am having trouble finding the coocox project “build” directory and any .d or .dep files.

    1>C:\Projects\DecaTag\DecaTag\components\coocox-master\cmsis_core\helloworld\helloworld_1\helloworld_1.c(14,10): error : hw_cmsis_core.h: No such file or directory
    1> #include “hw_cmsis_core.h”

    The output from coocox when I rebuild the project is as below. I have added each of the folders that appear in the compile to VS Make directories.

    arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -Wall -ffunction-sections -g -O0 -c -DSTM32F103CBT6 -IC:\Users\david\Documents\Decawave\Tag\components\coocox-master -IC:\Users\david\Documents\Decawave\Tag\components\coocox-master\cmsis_core\source
    -IC:\Users\david\Documents\Decawave\Tag -IC:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source -IC:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB -IC:\Users\david\Documents\Decawave\Tag\app\decadriver
    -IC:\Users\david\Documents\Decawave\Tag\app\platform
    -IC:\Users\david\Documents\Decawave\Tag\app
    -IC:\Users\david\Documents\Decawave\Tag\components\coocox-master\cmsis_core

    C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_rtc.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_tim.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_dbgmcu.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\system_stm32f10x.c C:\Users\david\Documents\Decawave\Tag\app\decadriver\deca_device.c C:\Users\david\Documents\Decawave\Tag\app\platform\deca_spi.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_fsmc.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\startup_stm32f10x_md.s C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_pwr.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_can.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_gpio.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_dac.c C:\Users\david\Documents\Decawave\Tag\app\main.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_crc.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_rcc.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_exti.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_adc.c C:\Users\david\Documents\Decawave\Tag\app\platform\deca_mutex.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_usart.c C:\Users\david\Documents\Decawave\Tag\app\platform\deca_sleep.c
    C:\Users\david\Documents\Decawave\Tag\app\platform\syscalls.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_flash.c C:\Users\david\Documents\Decawave\Tag\app\platform\stm32f10x_it.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_cec.c C:\Users\david\Documents\Decawave\Tag\app\platform\port.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_sdio.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_dma.c C:\Users\david\Documents\Decawave\Tag\app\platform\lcd.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\misc.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_wwdg.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_spi.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_i2c.c C:\Users\david\Documents\Decawave\Tag\app\decadriver\deca_params_init.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_bkp.c C:\Users\david\Documents\Decawave\Tag\components\coocox-master\STM32F10x_MD_STDLIB\source\stm32f10x_iwdg.c

    #21332
    orbitcoms
    Participant

    BTW: This is the project folder structure attached.

     

     

    Attachments:
    You must be logged in to view attached files.
    #21334
    orbitcoms
    Participant

    It appears the file is not on the drive. I opened up the “helloworld.c” project and when attempting to compile it, it does not compile due to missing files.

    I have no idea what this “helloworld” file is. Can it be removed?

    Attachments:
    You must be logged in to view attached files.
    #21336
    orbitcoms
    Participant

    UPDATE: I removed the hellowworld folders and the coocox project compiles ok still. I then recreated the project and now when I compile in VS, I get heaps of duplicate definition file errors (hundreds).

    Is there a folder I should be removing?

    1>C:/SysGCC/arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0 -mcpu=cortex-m3 -mthumb -Iapp/decadriver -Iapp/platform -Icomponents/coocox-master/cmsis_core/source -Icomponents/coocox-master/STM32F10x_HD_STDLIB/source -I. -DDEBUG=1 -DARM_MATH_CM3 -DSTM32F103C8 -c components/coocox-master/STM32F10x_MD_STDLIB/source/system_stm32f10x.c -o Debug/system_stm32f10x.o -MD -MF Debug/system_stm32f10x.dep
    1>C:/SysGCC/arm-eabi/bin/arm-eabi-gcc.exe -ggdb -ffunction-sections -O0 -mcpu=cortex-m3 -mthumb -Iapp/decadriver -Iapp/platform -Icomponents/coocox-master/cmsis_core/source -Icomponents/coocox-master/STM32F10x_HD_STDLIB/source -I. -DDEBUG=1 -DARM_MATH_CM3 -DSTM32F103C8 -c C:/Users/david/AppData/Local/VisualGDB/EmbeddedBSPs/arm-eabi/com.sysprogs.arm.stm32/STM32F1xxxx/StartupFiles/startup_stm32f103xb.c -o Debug/startup_stm32f103xb.o -MD -MF Debug/startup_stm32f103xb.dep
    1>C:/SysGCC/arm-eabi/bin/arm-eabi-g++.exe -o Debug/DecaTag.elf -Wl,-gc-sections -TC:/Users/david/AppData/Local/VisualGDB/EmbeddedBSPs/arm-eabi/com.sysprogs.arm.stm32/STM32F1xxxx/LinkerScripts/STM32F103C8_flash.lds -mcpu=cortex-m3 -mthumb -Wl,–start-group Debug/main.o Debug/deca_device.o Debug/deca_params_init.o Debug/deca_mutex.o Debug/deca_sleep.o Debug/deca_spi.o Debug/lcd.o Debug/port.o Debug/stm32f10x_it.o Debug/syscalls.o Debug/syscalls.o Debug/misc.o Debug/stm32f10x_adc.o Debug/stm32f10x_bkp.o Debug/stm32f10x_can.o Debug/stm32f10x_cec.o Debug/stm32f10x_crc.o Debug/stm32f10x_dac.o Debug/stm32f10x_dbgmcu.o Debug/stm32f10x_dma.o Debug/stm32f10x_exti.o Debug/stm32f10x_flash.o Debug/stm32f10x_fsmc.o Debug/stm32f10x_gpio.o Debug/stm32f10x_i2c.o Debug/stm32f10x_iwdg.o Debug/stm32f10x_pwr.o Debug/stm32f10x_rcc.o Debug/stm32f10x_rtc.o Debug/stm32f10x_sdio.o Debug/stm32f10x_spi.o Debug/stm32f10x_tim.o Debug/stm32f10x_usart.o Debug/stm32f10x_wwdg.o Debug/system_stm32f10x.o Debug/misc.o Debug/stm32f10x_adc.o Debug/stm32f10x_bkp.o Debug/stm32f10x_can.o Debug/stm32f10x_cec.o Debug/stm32f10x_crc.o Debug/stm32f10x_dac.o Debug/stm32f10x_dbgmcu.o Debug/stm32f10x_dma.o Debug/stm32f10x_exti.o Debug/stm32f10x_flash.o Debug/stm32f10x_fsmc.o Debug/stm32f10x_gpio.o Debug/stm32f10x_i2c.o Debug/stm32f10x_iwdg.o Debug/stm32f10x_pwr.o Debug/stm32f10x_rcc.o Debug/stm32f10x_rtc.o Debug/stm32f10x_sdio.o Debug/stm32f10x_spi.o Debug/stm32f10x_tim.o Debug/stm32f10x_usart.o Debug/stm32f10x_wwdg.o Debug/system_stm32f10x.o Debug/startup_stm32f103xb.o -Wl,–end-group
    1>Debug/syscalls.o: In function `_sbrk’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(24): error : multiple definition of `_sbrk’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:24: first defined here
    1>Debug/syscalls.o: In function `link’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(40): error : multiple definition of `link’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:40: first defined here
    1>Debug/syscalls.o: In function `_close’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(46): error : multiple definition of `_close’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:46: first defined here
    1>Debug/syscalls.o: In function `_fstat’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(52): error : multiple definition of `_fstat’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:52: first defined here
    1>Debug/syscalls.o: In function `_isatty’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(59): error : multiple definition of `_isatty’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:59: first defined here
    1>Debug/syscalls.o: In function `_lseek’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(65): error : multiple definition of `_lseek’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:65: first defined here
    1>Debug/syscalls.o: In function `_read’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(72): error : multiple definition of `_read’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:72: first defined here
    1>Debug/syscalls.o: In function `_write’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(94): error : multiple definition of `_write’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:94: first defined here
    1>Debug/syscalls.o: In function `abort’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(114): error : multiple definition of `abort’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:114: first defined here

    #21337
    orbitcoms
    Participant

    I wonder if I am almost there now. I downloaded a software program that looks for duplicate files and found the project had 2 folders for STBLIB (STM32F10x_MD_STDLID and STM32F100x_HD_STDLIB) so I looked into coocox list of project files and saw it was using the MD files. I then deleted the HD folder and found the project still compiled ok in Coocox. Then created a new Visual Studio project by importing the project folders again. Now I have just one issue with Syscalls. Is there an option in the Visual GDB import wizard I need to change or do I need to go to the folder components/coocox-master/c_library/source and delete “syscalls.c”?

    1>Debug/syscalls.o: In function `_sbrk’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(24): error : multiple definition of `_sbrk’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:24: first defined here
    1>Debug/syscalls.o: In function `link’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(40): error : multiple definition of `link’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:40: first defined here
    1>Debug/syscalls.o: In function `_close’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(46): error : multiple definition of `_close’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:46: first defined here
    1>Debug/syscalls.o: In function `_fstat’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(52): error : multiple definition of `_fstat’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:52: first defined here
    1>Debug/syscalls.o: In function `_isatty’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(59): error : multiple definition of `_isatty’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:59: first defined here
    1>Debug/syscalls.o: In function `_lseek’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(65): error : multiple definition of `_lseek’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:65: first defined here
    1>Debug/syscalls.o: In function `_read’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(72): error : multiple definition of `_read’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:72: first defined here
    1>Debug/syscalls.o: In function `_write’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(94): error : multiple definition of `_write’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:94: first defined here
    1>Debug/syscalls.o: In function `abort’:
    1>C:\Projects\DecaTag\components\coocox-master\C_library\source\syscalls.c(114): error : multiple definition of `abort’
    1>Debug/syscalls.o:C:\Projects\DecaTag/components/coocox-master/C_library/source/syscalls.c:114: first defined here
    1>c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-eabi/7.2.0/../../../../arm-eabi/bin/ld.exe : warning : cannot find entry symbol Reset_Handler; defaulting to 08000000
    1>collect2.exe : error : ld returned 1 exit status
    1>make: *** [Debug/DecaTag.elf] Error 1

    #21338
    orbitcoms
    Participant

    Apologies for the many posts, I see there is an “Edit” function I could have used to update the original.

    Anyway, I deleted the “syscalls.c” file mentioned in previous post and now the project compiles without error.

    I selected “None” for “C Library Type” and “None” for “Implementations for _sbrk() etc” in the VisualGDB project import wizard.

    Is this correct?

    I assume the project must be finding implementation for the functions of syscalls somewhere else in the project?

    #21349
    support
    Keymaster

    Hi,

    No problem, we will try to explain how this works.

    Function calls like _write() are the low-level calls used by the standard library to implement basic I/O. E.g. if you call printf(), the library itself will format the text and then will call _write() to actually send out the exact string. VisualGDB projects can have one of the following implementations of those functions:

    • Regular semihosting. Selected via the first page of VisualGDB Project Properties and is slower than the advanced semihosting. The output from printf() will appear inside Visual Studio.
    • Advanced semihosting. Selected by referencing the corresponding framework via VisualGDB Project Properties -> Embedded Frameworks. Similar to the regular semihosting, but only works with VisualGDB and is much faster than the regular one.
    • Any other implementation that is built together with your code (i.e. a .c or .cpp file defining those functions). E.g. it may redirect printf() output to a UART port.

    Most likely you have imported some implementation of those functions together with your project, causing conflicts between it and the regular semihosting. To fix this, you need to ensure that only one of the options mentioned above is enabled. One way to do this is to select “none” in VisualGDB Project Properties, another way is to remove syscalls.c from the project. If it looks like syscalls.c was just copied from the standard library and doesn’t add any functionality on top of that, we would suggest removing it to reduce the codebase size. Otherwise, disabling semihosting via VisualGDB Project Properties like you did, is the right way to go.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.