{"id":9175,"date":"2019-02-18T19:50:23","date_gmt":"2019-02-18T19:50:23","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=9175"},"modified":"2019-02-19T17:04:21","modified_gmt":"2019-02-19T17:04:21","slug":"stm32f072-linking-in-ses-and-atollic-ide","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=9175","title":{"rendered":"STM32F072: Linking in SES and Atollic IDE"},"content":{"rendered":"<p><a href=\"https:\/\/www.st.com\/en\/microcontrollers\/stm32f072cb.html\">STM32F072CB<\/a>, Mainstream ARM Cortex-M0 USB line MCU with 128 Kbytes Flash, 48 MHz CPU, USB, CAN and CEC functions<\/p>\n<h4>Specs<\/h4>\n<p><a href=\"http:\/\/www.mingw.org\/wiki\/HOWTO_Use_the_GCC_specs_file\">HOWTO Use the GCC specs file<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/5778449\/how-to-set-gcc-4-3-default-specs-file\">How to set gcc 4.3 default specs file?<\/a><br \/>\n<a href=\"http:\/\/ww1.microchip.com\/downloads\/en\/DeviceDoc\/Frequently-Asked-Questions-4.9.3.26.txt\">Frequently Asked Questions<\/a><\/p>\n<h4>Studio<\/h4>\n<p><a href=\"https:\/\/studio.segger.com\/index.htm?https:\/\/studio.segger.com\/using_external_gcc.htm\">Using External GCC<\/a><br \/>\n<a href=\"https:\/\/studio.segger.com\/index.htm?https:\/\/studio.segger.com\/emBuild_building_with_a_project_file.htm\">Building with a SEGGER Embedded Studio project file<\/a><\/p>\n<h4>Wiki<\/h4>\n<p><a href=\"https:\/\/wiki.segger.com\/SEGGER_Embedded_Studio#How_to_use_an_external_toolchain_with_Embedded_Studio\">How to use an external toolchain with Embedded Studio<\/a><\/p>\n<h4>Website<\/h4>\n<p><a href=\"https:\/\/www.segger.com\/products\/development-tools\/embedded-studio\/technology\/compiler\/\">Tool chain and Compiler<\/a><br \/>\n<a href=\"https:\/\/www.segger.com\/products\/development-tools\/embedded-studio\/technology\/project-management\/\">Project Management<\/a><br \/>\n<a href=\"https:\/\/www.segger.com\/products\/development-tools\/embedded-studio\/technology\/performance\/\">Performance<\/a><br \/>\n<a href=\"https:\/\/www.segger.com\/products\/development-tools\/embedded-studio\/technology\/tools\/segger-linker\/\">SEGGER Linker<\/a><\/p>\n<h4>Blog<\/h4>\n<p><a href=\"https:\/\/blog.segger.com\/the-segger-linker-replacing-the-gnu-linker\/\">The SEGGER Linker \u2013 Replacing the GNU linker<\/a><br \/>\n<a href=\"https:\/\/blog.segger.com\/killer-features-of-the-segger-linker-or-whats-wrong-with-the-gnu-linker\/\">Killer features of the SEGGER linker, or what\u2019s wrong with the GNU linker?<\/a><\/p>\n<h4>A C Library for embedded applications<\/h4>\n<p>Most GCC based projects use Newlib or its smaller version Newlib nano as the standard C Library. Newlib has been created for full-featured computers with lots of memory. Even Newlib nano might require a lot of stack and even heap for functions, such as printf.<\/p>\n<p>Embedded Studio comes with its own standard C Library. The library has been created from scratch, tailored and optimized for embedded applications, to be used on even the smallest micros.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ncd C:\\msys64\\home\\bachman0\\Fluoedema\\Firmware\r\n&quot;C:\\Program Files\\SEGGER\\SEGGER Embedded Studio for ARM 4.12\\bin\\emBuild.exe&quot; -echo -config &quot;Debug&quot; Fluoedema.emProject\r\n&quot;C:\\Program Files\\SEGGER\\SEGGER Embedded Studio for ARM 4.12\\bin\\emBuild.exe&quot; -echo -clean -config &quot;Debug&quot; Fluoedema.emProject\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n4&gt;C:\/Program Files\/SEGGER\/SEGGER Embedded Studio for ARM 4.12\/gcc\/arm-none-eabi\/bin\/cc1\r\n-fmessage-length=0\r\n-fno-diagnostics-show-caret\r\n-mcpu=cortex-m0\r\n-mlittle-endian\r\n-mfloat-abi=soft\r\n-mthumb\r\n-mtp=soft\r\n-mno-unaligned-access\r\n-nostdinc\r\n-isystemC:\/Program Files\/SEGGER\/SEGGER Embedded Studio for ARM 4.12\/include\r\n-isystemC:\/Users\/bachman0\/AppData\/Local\/SEGGER\/SEGGER Embedded Studio\/v3\/packages\/include\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/src\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/inc\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/inc\/chibi\/board\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/inc\/chibi\/hal\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/inc\/chibi\/osal\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/inc\/chibi\/platform\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/inc\/chibi\/startup\/CMSIS\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/inc\/chibi\/startup\/ST\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/inc\/chibi\/startup\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/inc\/chibi\/various\r\n-IC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/inc\/chibi\/lib\r\n-D__SIZEOF_WCHAR_T=4\r\n-D__ARM_ARCH_6M__\r\n-D__SES_ARM\r\n-D__SES_VERSION=41200\r\n-DDEBUG -DCRT1_AREAS_NUMBER=1\r\n-DSTM32F072B_DISCO\r\n-DSTM32F072RBTx\r\n-DSTM32F0\r\n-DSTM32\r\n-DDEBUG\r\n-DHAL_USE_USB=TRUE\r\n-DHAL_USE_SPI=TRUE\r\n-DHAL_USE_SERIAL=TRUE\r\n-DHAL_USE_ADC=TRUE\r\n-DHAL_USE_UART=FALSE\r\n-DHAL_USE_GPT=TRUE\r\n-DSTM32_GPT_USE_TIM14=TRUE\r\n-DHAL_USE_WDG=TRUE\r\n-DSTM32_WDG_USE_IWDG=TRUE\r\n-MD C:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/Debug\/sen.d\r\n-MQ Debug\/sen.o\r\n-quiet\r\n-std=gnu99\r\n-g3\r\n-gpubnames\r\n-Og\r\n-fomit-frame-pointer\r\n-fno-dwarf2-cfi-asm\r\n-fno-builtin\r\n-ffunction-sections\r\n-fdata-sections\r\n-fshort-enums\r\n-fno-common\r\nC:\\msys64\\home\\bachman0\\Fluoedema\\Firmware\\src\\sen.c\r\n-o C:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/Debug\/sen.asm\r\n\r\n4&gt;C:\/Program Files\/SEGGER\/SEGGER Embedded Studio for ARM 4.12\/gcc\/arm-none-eabi\/bin\/as\r\n--traditional-format\r\n-mcpu=cortex-m0\r\n-mlittle-endian\r\n-mfloat-abi=soft\r\n-mthumb\r\nC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/Debug\/sen.asm\r\n-o Debug\/sen.o\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nundefined reference to __aeabi_read_tp\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nC:\\msys64\\home\\bachman0\\Fluoedema\\Firmware&gt;\r\n&quot;C:\\Program Files\\SEGGER\\SEGGER Embedded Studio for ARM 4.12\\bin\\emBuild.exe&quot; -echo -config &quot;Debug&quot; Fluoedema.emProject\r\n\r\n1&gt;C:\/Program Files\/SEGGER\/SEGGER Embedded Studio for ARM 4.12\/gcc\/arm-none-eabi\/bin\/ld\r\n-X\r\n--omagic\r\n-eReset_Handler\r\n--defsym=__vfprintf=__vfprintf_int_nwp\r\n--defsym=__vfscanf=__vfscanf_int\r\n-EL\r\n--gc-sections\r\n-TC:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/LinkerScript.ld\r\n-Map Output\/Debug\/Exe\/Firmware.map\r\n--defsym=__main_stack_size__=0x600\r\n--defsym=__process_stack_size__=0x000\r\n-u_vectors\r\n-o Output\/Debug\/Exe\/Firmware.elf\r\n--emit-relocs\r\n--start-group\r\n@C:\/msys64\/home\/bachman0\/Fluoedema\/Firmware\/Output\/Firmware Debug\/Obj\/Firmware.ind\r\n--end-group\r\n\r\nC:\/Program Files\/SEGGER\/SEGGER Embedded Studio for ARM 4.12\/lib\/libc_v6m_t_le_eabi.a(libc2.o):\r\nIn function `__aeabi_errno_addr':\r\nlibc2.c:(.text.libc.__aeabi_errno_addr+0x2): undefined reference to `__aeabi_read_tp'\r\nThere were 1 build errors\r\n<\/pre>\n<h1>cc1<\/h1>\n<p><a href=\"https:\/\/unix.stackexchange.com\/questions\/77779\/relationship-between-cc1-and-gcc\">Relationship between cc1 and gcc?<\/a><br \/>\n<a href=\"https:\/\/en.wikibooks.org\/wiki\/GNU_C_Compiler_Internals\/GNU_C_Compiler_Architecture\">GNU C Compiler Internals\/GNU C Compiler Architecture<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ncc1 -o test.s test.c\r\nfrom C to ASM!\r\n<\/pre>\n<h1>EABI<\/h1>\n<p><a href=\"https:\/\/github.com\/m-labs\/uclibc-lm32\/blob\/master\/libc\/sysdeps\/linux\/arm\/aeabi_errno_addr.c\">github.com\/m-labs\/uclibc-lm32\/blob\/master\/libc\/sysdeps\/linux\/arm\/aeabi_errno_addr.c<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n_AEABI_PORTABILITY_LEVEL=1\r\n<\/pre>\n<p><a href=\"https:\/\/e2e.ti.com\/support\/tools\/ccs\/f\/81\/t\/462914\">How to use errno in multithread environment?<\/a><br \/>\n<a href=\"http:\/\/infocenter.arm.com\/help\/index.jsp?topic=\/com.arm.doc.dui0475m\/chr1359122847793.html\">__aeabi_errno_addr()<\/a><br \/>\n<a href=\"https:\/\/community.nxp.com\/thread\/390235\">caddr_t<\/a><\/p>\n<h1>syscalls<\/h1>\n<p><a href=\"https:\/\/freertos.org\/FreeRTOS_Support_Forum_Archive\/February_2012\/freertos_syscalls.c_compilation_errors._5075056.html\">syscalls.c compilation errors<\/a><br \/>\n<a href=\"https:\/\/www.sokoide.com\/wp\/2015\/05\/18\/implementing-syscalls-for-libc\/\">IMPLEMENTING SYSCALLS FOR LIBC<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/25851138\/how-to-include-syscalls-c-from-a-separate-library-file\">How to include syscalls.c from a separate library file?<\/a><\/p>\n<h1>newlib<\/h1>\n<p><a href=\"https:\/\/sites.google.com\/site\/stm32discovery\/open-source-development-with-the-stm32-discovery\/getting-newlib-to-work-with-stm32-and-code-sourcery-lite-eabi\">Getting NewLib and printf to work with the STM32 and Code Sourcery Lite eabi<\/a><br \/>\n<a href=\"https:\/\/balau82.wordpress.com\/2010\/12\/16\/using-newlib-in-arm-bare-metal-programs\/\">Using Newlib in ARM bare metal programs<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/41662366\/issue-with-compling-arm-assembly-code\">Issue with compling ARM assembly code<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\narm-none-eabi-as p1.s -o p1.o\r\narm-none-eabi-gcc -specs=rdimon.specs p1.o -o p1\r\narm-none-eabi-gcc: error: rdimon.specs: No such file or directory\r\n<\/pre>\n<p><a href=\"https:\/\/community.nxp.com\/thread\/480341\">Linking issues<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n  GROUP (\r\n&quot;libcr_semihost_nf.a&quot;\r\n&quot;libcr_c.a&quot;\r\n&quot;libcr_eabihelpers.a&quot;\r\n)\r\n<\/pre>\n<h1>-specs=rdimon.specs<\/h1>\n<p><a href=\"https:\/\/community.nxp.com\/thread\/376936\">Link problem with rdimon.specs<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/13235748\/linker-error-on-a-c-project-using-eclipse\">Linker error on a C project using Eclipse<\/a><\/p>\n<h1>Semihosting<\/h1>\n<p><a href=\"http:\/\/www.keil.com\/support\/man\/docs\/armcc\/armcc_pge1358787046598.htm\">What is semihosting?<\/a><br \/>\n<a href=\"http:\/\/infocenter.arm.com\/help\/index.jsp?topic=\/com.arm.doc.dui0471g\/Bgbjjgij.html\">What is semihosting?<\/a><br \/>\n<a href=\"https:\/\/community.nxp.com\/thread\/389156\">What is Semihosting?<\/a><br \/>\n<a href=\"https:\/\/www.mikrocontroller.net\/topic\/292719\">Semihosting f\u00fcr ARM verwenden<\/a><\/p>\n<h1>Specs to Linker?<\/h1>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/27553870\/how-to-pass-specs-to-gcc-linker\">How to pass specs to gcc linker?<\/a><\/p>\n<h1>ld or gcc<\/h1>\n<p><a href=\"https:\/\/renenyffenegger.ch\/notes\/development\/languages\/C-C-plus-plus\/GCC\/options\/Wl\/index\">gcc -Wl,linker-option<\/a><br \/>\n<a href=\"https:\/\/gcc.gnu.org\/onlinedocs\/gcc\/Link-Options.html\">Options for Linking<\/a><\/p>\n<h1>ARM Simulator<\/h1>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n(gdb) target sim\r\nUndefined target command: &quot;sim&quot;.  Try &quot;help target&quot;.\r\n\r\n.\/configure --enable-sim\r\n<\/pre>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/49470659\/arm-none-eabi-gdb-undefined-target-command-sim\">arm-none-eabi-gdb: Undefined target command: \u201csim\u201d<\/a><br \/>\n<a href=\"http:\/\/cs107e.github.io\/guides\/gdb\/\">Guide to using GDB in simulation mode<\/a><br \/>\n<a href=\"https:\/\/answers.launchpad.net\/gcc-arm-embedded\/+question\/215887\">Does arm-none-eabi-gdb support simulator<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>STM32F072CB, Mainstream ARM Cortex-M0 USB line MCU with 128 Kbytes Flash, 48 MHz CPU, USB, CAN and CEC functions Specs HOWTO Use the GCC specs file How to set gcc 4.3 default specs file? Frequently Asked Questions Studio Using External GCC Building with a SEGGER Embedded Studio project file Wiki How to use an external [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9175","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/9175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9175"}],"version-history":[{"count":10,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/9175\/revisions"}],"predecessor-version":[{"id":9192,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/9175\/revisions\/9192"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}