<?xml-stylesheet type="text/xsl" href="https://community.element14.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/"><channel><title>Renesas RX65 Envision Kit - part 10: Reserve LCD Frame Buffer in Expansion RAM with GCC</title><link>/technologies/embedded/b/blog/posts/renesas-rx65-envision-kit---part-10-reserve-lcd-frame-buffer-in-expansion-ram-with-gcc</link><description>I&amp;#39;m evaluating the Renesas RX65N MCU EV Kit .In this post, a mechanism to reserve memory for the LCD module frame buffer with the GCC toolchain LCD Frame BufferThe Renesas library for LCD, r_glcdc_rx, supports two frame buffers.These are me...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Renesas RX65 Envision Kit - part 10: Reserve LCD Frame Buffer in Expansion RAM with GCC</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/renesas-rx65-envision-kit---part-10-reserve-lcd-frame-buffer-in-expansion-ram-with-gcc</link><pubDate>Tue, 21 Jan 2020 11:18:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d3df36d4-a30c-4249-8b8e-d960b01784f2</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Here&amp;#39;s how Trinamic approach fixing something in a known location. Their firmware and boot loader both expect that a structure is at a specific memory location.&lt;/p&gt;&lt;p&gt;It&amp;#39;s interesting to see this used in the real world.&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="https://github.com/trinamic/TMC-EvalSystem/blob/master/main.c" rel="nofollow ugc noopener" target="_blank" title="https://github.com/trinamic/TMC-EvalSystem/blob/master/main.c"&gt;https://github.com/trinamic/TMC-EvalSystem/blob/master/main.c&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="https://github.com/trinamic/TMC-EvalSystem/blob/master/hal/Landungsbruecke/freescale/MK20DN512-TMCM.ld" rel="nofollow ugc noopener" target="_blank" title="https://github.com/trinamic/TMC-EvalSystem/blob/master/hal/Landungsbruecke/freescale/MK20DN512-TMCM.ld"&gt;https://github.com/trinamic/TMC-EvalSystem/blob/master/hal/Landungsbruecke/freescale/MK20DN512-TMCM.ld&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In the code, they use GCC specific construct to place it in a known memory section:&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=struct+BootloaderConfig+%7B%0Auint32_t+BLMagic%3B%0Auint32_t+drvEnableResetValue%3B%0A%7D%3B%0A%0A%2F%2F+This+struct+gets+placed+at+a+specific+address+by+the+linker%0Astruct+BootloaderConfig+__attribute__+%28%28section%28%22.bldata%22%29%29%29+BLConfig%3B]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In the linker file, this section is placed at a known location: the begin of RAM:&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=%2F*+Specify+the+memory+areas+*%2F%0AMEMORY%0A%7B%0A++m_interrupts+%28rx%29+%3A+ORIGIN+%3D+0x00008000%2C+LENGTH+%3D+0x1BC%0A++m_cfmprotrom+%28rx%29+%3A+ORIGIN+%3D+0x00008400%2C+LENGTH+%3D+0x10%0A++m_text+%28rx%29+%3A+ORIGIN+%3D+0x00008410%2C+LENGTH+%3D+512K-32K-0x410%0A++m_data++++%28rwx%29+%3A+ORIGIN+%3D+0x1FFF0000%2C+LENGTH+%3D+128K+%2F*+SRAM+*%2F%0A%7D%0A%2F%2F+...%0A++%2F*+special+area+for+data+exchange+between+boot+loader+and+application%0A+++++at+the+beginning+of+the+RAM*%2F%0A++.bldata+%28NOLOAD%29+%3A%0A++%7B%0A++++.+%3D+ALIGN%284%29%3B%0A++++KEEP%28*%28.bldata%29%29%0A++++.+%3D+ALIGN%284%29%3B%0A++%7D+%3E+m_data]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8421&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Renesas RX65 Envision Kit - part 10: Reserve LCD Frame Buffer in Expansion RAM with GCC</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/renesas-rx65-envision-kit---part-10-reserve-lcd-frame-buffer-in-expansion-ram-with-gcc</link><pubDate>Fri, 20 Dec 2019 16:08:29 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d3df36d4-a30c-4249-8b8e-d960b01784f2</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The defect that I logged with Renesas for the wrong memory section in the GCC linker file is not going in the right direction: &lt;a class="jive-link-external-small" href="https://renesasrulz.com/rx/f/rx---forum/15513/ram2-section-in-gcc-linker-script-starts-at-0x80000" rel="nofollow ugc noopener" target="_blank" title="https://renesasrulz.com/rx/f/rx---forum/15513/ram2-section-in-gcc-linker-script-starts-at-0x80000"&gt;https://renesasrulz.com/rx/f/rx---forum/15513/ram2-section-in-gcc-linker-script-starts-at-0x80000&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I raised that the project generator creates a linker file with incorrect RAM addresses and they ask me if I fixed it meanwhile &lt;span&gt;[View:/resized-image/__size/16x16/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-d3df36d4-a30c-4249-8b8e-d960b01784f2/3681.contentimage_5F00_1.png:16:16]&lt;/span&gt;...&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8421&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Renesas RX65 Envision Kit - part 10: Reserve LCD Frame Buffer in Expansion RAM with GCC</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/renesas-rx65-envision-kit---part-10-reserve-lcd-frame-buffer-in-expansion-ram-with-gcc</link><pubDate>Thu, 12 Dec 2019 19:36:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d3df36d4-a30c-4249-8b8e-d960b01784f2</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;What I didn&amp;#39;t tell:&lt;/p&gt;&lt;p&gt;If you&amp;#39;re just interested in getting a variable or buffer into the expansion RAM, it would suffice to just create a section n the linker file, then&amp;nbsp; use:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=uuint32+__attribute__%28%28section+%28%22.FRAME_BUFFER%22%29%29%29+frameBuffer%5Bsize%5D%3B]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The thing with a big buffer like the LCD driver&amp;#39;s frame buffer - especially in a microcontroller where there aren&amp;#39;t many big chunks of memory available - is that it&amp;#39;s hard to get 232000 bytes available in a continuous block available if you don&amp;#39;t manage it.&lt;/p&gt;&lt;p&gt;That&amp;#39;s why in this case putting it in a known available block makes sense. The linker can have fun allocating room for te small variables. That&amp;#39;s not hard, even in a broken memory chunk.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;What I didn&amp;#39;t tell part 2:&lt;/p&gt;&lt;p&gt;I would not use my method to reserve the memory addresses for registers and memory mapped devices.&lt;/p&gt;&lt;p&gt;In that case, I&amp;#39;d just not make those memory chunks available in the loader script, and use header files - like the majority of HAL layers and microcontroller frameworks do for this type of memory areas.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;(&lt;/p&gt;&lt;p&gt;also the Renesas tool chains do that. The red areas below are made unavailable to the linker, and the header files generate all the register addresses and structures:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/338x180/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-d3df36d4-a30c-4249-8b8e-d960b01784f2/contentimage_5F00_205579.png:338:180]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;)&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8421&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Renesas RX65 Envision Kit - part 10: Reserve LCD Frame Buffer in Expansion RAM with GCC</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/renesas-rx65-envision-kit---part-10-reserve-lcd-frame-buffer-in-expansion-ram-with-gcc</link><pubDate>Thu, 12 Dec 2019 14:55:18 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d3df36d4-a30c-4249-8b8e-d960b01784f2</guid><dc:creator>Andrew J</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Interesting.&amp;nbsp; I don&amp;#39;t get why the 2nd block would overrun into the reserved area at 0x00108000.&amp;nbsp; Wouldn&amp;#39;t it overrun into the area after 0x00860000?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8421&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>