<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Soft Device + Application flash doesn&amp;#39;t work with Eclipse</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58433/soft-device-application-flash-doesn-t-work-with-eclipse</link><description>Hello all, 
 
 I struggle to program nrf52 on Eclipse, and it works fine with Keil. Let me explain : 
 With Keil : 
 -I first flash softdevice 5.0 manually with JFlash Lite 
 -I flash my code with Keil, 
 it works fine. I can flash a merged hex file and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Mar 2020 08:46:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58433/soft-device-application-flash-doesn-t-work-with-eclipse" /><item><title>RE: Soft Device + Application flash doesn't work with Eclipse</title><link>https://devzone.nordicsemi.com/thread/237633?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 08:46:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5a23cd8-95b0-4a6a-8eb7-a360c1d92418</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Ok I see. &amp;nbsp;You can use __attribute__ section on the data array then map that to anywhere in the linker script, See&amp;nbsp;&lt;a href="https://stackoverflow.com/questions/19781375/how-to-place-constant-at-specific-address-with-ld-linker-command-file"&gt;https://stackoverflow.com/questions/19781375/how-to-place-constant-at-specific-address-with-ld-linker-command-file&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That way you don&amp;#39;t need to reduce your flash length.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device + Application flash doesn't work with Eclipse</title><link>https://devzone.nordicsemi.com/thread/237623?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 08:22:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2a9c5d5-212a-4d4f-b3be-a52ace70d27b</guid><dc:creator>Ben34</dc:creator><description>&lt;p&gt;Yes it is nRF52832. I have data stored at 0x38000 and for the moment, I can&amp;#39;t move them. 0x38000-0x23000 = 0x15000, that is why I specified this size for the code. At 0x3D000 there would be a bootloader in the near future, and after, a buffer zone for soft device, and a buffer zone for code. I could use -Os, which is very useful, but I need another code optimisation to make my code fit. That is why I looked for libraries like microlib&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device + Application flash doesn't work with Eclipse</title><link>https://devzone.nordicsemi.com/thread/237572?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 22:43:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9dda4b5-e9b0-4566-bb65-7e6b540d6471</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Well, what is your nRF52 chip ? The nRF52832 has 512KB flash which 0x80000. &amp;nbsp;The firmware starts at 0x23000 which gives you the length 0x80000 - 0x23000 = 0x5D000 size. 0x15000 is only 86KB, way too small. &amp;nbsp;The nRF52810 has 256KB Flash if I remember.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device + Application flash doesn't work with Eclipse</title><link>https://devzone.nordicsemi.com/thread/237571?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 22:31:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cea605f-d6a4-475a-9096-8a8917a89aec</guid><dc:creator>Ben34</dc:creator><description>&lt;p&gt;Thank you for the advice. Unfortunately, with -Os : it still overflows by 276 bytes. I could increase FLASH lenght a little bit, but it will delay the issue : my code is going to be bigger. In Keil, it compiles fine with -O2, and I would like to have this results in Eclipse. nano.specs is already set. here is a piece of my Makefile, I think it could help : &lt;/p&gt;
&lt;p&gt;# Libraries common to all targets&lt;br /&gt;LIB_FILES += \&lt;br /&gt;&lt;br /&gt;# Optimization flags&lt;br /&gt;OPT = -O2 -g3 &lt;br /&gt;# Uncomment the line below to enable link time optimization&lt;br /&gt;#OPT += -flto&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CPPFLAGS += BOARD_PCA10040 &lt;br /&gt;CPPFLAGS += NRF52 NRF52832_XXAA &lt;br /&gt;CPPFLAGS += NRF52_PAN_74 &lt;br /&gt;CPPFLAGS += NRF_SD_BLE_API_VERSION=5 &lt;br /&gt;CPPFLAGS += S132 &lt;br /&gt;CPPFLAGS += SOFTDEVICE_PRESENT &lt;br /&gt;CPPFLAGS += SWI_DISABLE0&lt;br /&gt;&lt;br /&gt;# C flags common to all targets&lt;br /&gt;CFLAGS += $(OPT)&lt;br /&gt;CFLAGS += -DBOARD_PCA10040&lt;br /&gt;CFLAGS += -DCONFIG_GPIO_AS_PINRESET&lt;br /&gt;CFLAGS += -DNRF52&lt;br /&gt;CFLAGS += -DNRF52832_XXAA&lt;br /&gt;CFLAGS += -DNRF52_PAN_74&lt;br /&gt;CFLAGS += -DNRF_SD_BLE_API_VERSION=5&lt;br /&gt;CFLAGS += -DS132&lt;br /&gt;CFLAGS += -DSOFTDEVICE_PRESENT&lt;br /&gt;CFLAGS += -DSWI_DISABLE0&lt;br /&gt;CFLAGS += -mcpu=cortex-m4&lt;br /&gt;CFLAGS += -mthumb -mabi=aapcs&lt;br /&gt;CFLAGS +=&amp;nbsp; -Wall&lt;br /&gt;CFLAGS += -Werror=implicit-function-declaration&lt;br /&gt;CFLAGS += -Wno-unused-function -Wno-comment -Wno-unused-variable&lt;br /&gt;CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16&lt;br /&gt;CFLAG += -split_sections&lt;br /&gt;CFLAG += -apcs=interwork&lt;br /&gt;CFLAG += --cpu Cortex-M4.fp&lt;br /&gt;# keep every function in a separate section, this allows linker to discard unused ones&lt;br /&gt;CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing&lt;br /&gt;CFLAGS += -fno-builtin -fshort-enums &lt;br /&gt;CFLAG += --library_type=microlib&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# C++ flags common to all targets&lt;br /&gt;CXXFLAGS += $(OPT)&lt;br /&gt;&lt;br /&gt;# Assembler flags common to all targets&lt;br /&gt;ASMFLAGS += -O2 -g3 &lt;br /&gt;ASMFLAGS += -mcpu=cortex-m4&lt;br /&gt;ASMFLAGS += -mthumb -mabi=aapcs&lt;br /&gt;ASMFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16&lt;br /&gt;ASMFLAGS += -DBOARD_PCA10040&lt;br /&gt;ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET&lt;br /&gt;ASMFLAGS += -DNRF52&lt;br /&gt;ASMFLAGS += -DNRF52832_XXAA&lt;br /&gt;ASMFLAGS += -DNRF52_PAN_74&lt;br /&gt;ASMFLAGS += -DNRF_SD_BLE_API_VERSION=5&lt;br /&gt;ASMFLAGS += -DS132&lt;br /&gt;ASMFLAGS += -DSOFTDEVICE_PRESENT&lt;br /&gt;ASMFLAGS += -DSWI_DISABLE0&lt;br /&gt;ASMFLAGS += -D__MICROLIB&lt;br /&gt;&lt;br /&gt;# Linker flags&lt;br /&gt;LDFLAGS += $(OPT)&lt;br /&gt;LDFLAGS += -mthumb -mabi=aapcs -L $(TEMPLATE_PATH) -T$(LINKER_SCRIPT)&lt;br /&gt;LDFLAGS += -mcpu=cortex-m4&lt;br /&gt;LDFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16&lt;br /&gt;LDFLAG += --library_type=microlib&lt;br /&gt;# let linker dump unused sections&lt;br /&gt;LDFLAGS += -Wl,--gc-sections &lt;br /&gt;# use newlib in nano version&lt;br /&gt;LDFLAGS += -specs=nano.specs -lc -lnosys -lm&lt;/p&gt;
&lt;p&gt;I tried to copy compiler command lines and asm command line from Keil.&lt;/p&gt;
&lt;p&gt;I tried to make gcc use microlib; but either I put the line or not, it doesn&amp;#39;t change anything&lt;/p&gt;
&lt;p&gt;Thank you for support :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device + Application flash doesn't work with Eclipse</title><link>https://devzone.nordicsemi.com/thread/237563?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 20:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42993311-549b-4697-9623-6a562ca249dd</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;For GCC optimization for space, use -Os&lt;/p&gt;
&lt;p&gt;For newlib nano, use linker parameter --specs=nano.specs&lt;/p&gt;
&lt;p&gt;It is better to use Eclipse native project than makefile project. &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device + Application flash doesn't work with Eclipse</title><link>https://devzone.nordicsemi.com/thread/237561?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 20:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7345bba6-8507-4f74-87f0-1319d4757ebb</guid><dc:creator>Ben34</dc:creator><description>&lt;p&gt;UPDATE : I found out what&amp;nbsp;is going on : I am using the default .ld file provided in an SDK example and the FLASH lenght was specifed to 5D000, wich is too much : I had data around 0x39000 which were corrupted. When I specify Keil parameter (0x15000), my code doesn&amp;#39;t compile anymore! I am facing flash overflow! Now I know Keil was performing size optimisation I have to tell gcc to do. (because in Keil, the code compiles)&lt;/p&gt;
&lt;p&gt;I set the same Optimisation level as Keil (O2) but I don&amp;#39;t know how to tell gcc to use microlib library.&lt;/p&gt;
&lt;p&gt;Could someone help please?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device + Application flash doesn't work with Eclipse</title><link>https://devzone.nordicsemi.com/thread/237140?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 13:26:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70dc7946-ff20-4846-af8f-cc6d5b410cf5</guid><dc:creator>Ben34</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for you response :) I am working with Makefile, and nrf commands like nrfjprog. I tried to use an example (low power pwm) and I managed to make it work! So something must be wrong with my initial code. I cocmmented all my main, and only used gpio for LED blinking : not succeed.; I try to run some debug to finid out what is going on, you&amp;#39;ll be in touch&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device + Application flash doesn't work with Eclipse</title><link>https://devzone.nordicsemi.com/thread/236978?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 17:47:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3092105-74b3-454a-9b81-26c3e9b7dba4</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Eclipse does not automatically flash softdevice. &amp;nbsp;You need to flash Softdevice before from outside then Eclipse can flash and debug your firmware. Flashing Softdevice is only need to be done once. &amp;nbsp;You can refresh your firmware in Eclipse as many times as you like as long that you don&amp;#39;t erase the softdevice region.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Follow this blog to use Eclipse with nRF series&amp;nbsp;&lt;a href="https://embeddedsoftdev.blogspot.com/p/ehal-nrf51.html"&gt;https://embeddedsoftdev.blogspot.com/p/ehal-nrf51.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>