<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Not able to access RAM in MK65F180M using MQX in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Not-able-to-access-RAM-in-MK65F180M-using-MQX/m-p/395490#M13280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two points:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;You wrote memory from 0x1fff27c0 to 0x2002FFF0 in one loop. You used byte writes in C language – that is correct, but I would like to recommend check also assembler code. It is highly possible that compiler optimizes this code and you will write by words and in extreme case unaligned words. 0x20000000 is boundary between two memory controllers and any unaligned access across this boundary will cause bus fault. Therefore system allocates dummy data from 0x1ffffff4 to 0x20000004 for avoid placing any data across this boundary.&lt;/LI&gt;&lt;LI&gt;Be aware, memory marked as Free by allocator doesn’t mean that it is empty memory. At start of free block is stored allocators header with pointer to next free block,…&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Therefore I would like to recommend start with your test with some minimal offset. I am not sure now how big is this header, but I suppose that 64bytes should by fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, you could start from 0x1FFF2800 and continue to 0x2002FFF0 with exception around 0x20000000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, in all cases it is bad idea to try rewriting memory which is currently available for allocator.&lt;/P&gt;&lt;P&gt;If you want testing memory, correct way should be allocate block as first and after that test it or test it prior you call allocator start (prior you call _mqx() function).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want allocate some memory for your own variables out of system, please modify your linker file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Apr 2015 12:54:22 GMT</pubDate>
    <dc:creator>RadekS</dc:creator>
    <dc:date>2015-04-17T12:54:22Z</dc:date>
    <item>
      <title>Not able to access RAM in MK65F180M using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Not-able-to-access-RAM-in-MK65F180M-using-MQX/m-p/395489#M13279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #003366;"&gt;Hello everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;We are trying to port our Bluetooth stack to MK65F180M using MQX. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;From the IAR flash file, we understand that the below are the RAM and ROM memory locations&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="color: #1f4e79;"&gt;ROM - 0x00000000 to 0x000FFFFF&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="color: #1f4e79;"&gt;RAM - 0x1FFF0000 to 0x2002FFF0&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="center" style="text-align: center;"&gt;&lt;SPAN style="color: #1f4e79;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;We were trying to use the hello example from the MQX. We were able to run that successfully. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;When we look at the IAR MQX plugin we can see &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;MQX memory&lt;/SPAN&gt;&lt;SPAN style="color: #1f4e79;"&gt; allocations (Please see the attached file Mem_Alloc.pdf).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;I can see that a maximum of 10 KB is used for the Kernel including the thread stack.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;To make sure that the rest 245 KB is accessible to us, I wrote a small code to write to the free RAM locations. From &lt;/SPAN&gt;&lt;SPAN style="color: red;"&gt;0x1FFF27c0 to 0x20000000 &lt;/SPAN&gt;&lt;SPAN style="color: #1f4e79;"&gt;(free 55K) and from &lt;/SPAN&gt;&lt;SPAN style="color: red;"&gt;0x20000001 to 0x2002FFF0&lt;/SPAN&gt;&lt;SPAN style="color: #1f4e79;"&gt; (Free 192K) (Please refer to the attached file Write_RAM.txt).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;But &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;when I execute the test application, control&lt;/SPAN&gt; &lt;SPAN style="color: #1f497d;"&gt;goes&lt;/SPAN&gt;&lt;SPAN style="color: #1f4e79;"&gt; to _int_kernel_isr (I believe because of some hard fault) while trying to write to some random memory location (this address keeps changing every time I restart the application). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;I’m not sure if something I do here is wrong. Also, when I look at the Flash file used in IAR, I can see certain RAM locations are used by the Kernel. For example.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #1f4e79;"&gt;define exported symbol __KERNEL_AREA_START = __ICFEDIT_region_RAM_start__;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #1f4e79;"&gt;define exported symbol __KERNEL_AREA_END = 0x20007FF0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;So, I’m a little bit confused about which part of the RAM is actually given to the USER. Please help me understand which part of the RAM can be used by the USER without any interference from the kernel. I have also attached the flash file that I’m using for your reference(initflash.icf).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;Your help is much appreciated. Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f4e79;"&gt;Vivek&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338714"&gt;Write_RAM.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338714"&gt;intflash.icf.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2015 00:38:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Not-able-to-access-RAM-in-MK65F180M-using-MQX/m-p/395489#M13279</guid>
      <dc:creator>viveksrinivasan</dc:creator>
      <dc:date>2015-04-10T00:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to access RAM in MK65F180M using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Not-able-to-access-RAM-in-MK65F180M-using-MQX/m-p/395490#M13280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two points:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;You wrote memory from 0x1fff27c0 to 0x2002FFF0 in one loop. You used byte writes in C language – that is correct, but I would like to recommend check also assembler code. It is highly possible that compiler optimizes this code and you will write by words and in extreme case unaligned words. 0x20000000 is boundary between two memory controllers and any unaligned access across this boundary will cause bus fault. Therefore system allocates dummy data from 0x1ffffff4 to 0x20000004 for avoid placing any data across this boundary.&lt;/LI&gt;&lt;LI&gt;Be aware, memory marked as Free by allocator doesn’t mean that it is empty memory. At start of free block is stored allocators header with pointer to next free block,…&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Therefore I would like to recommend start with your test with some minimal offset. I am not sure now how big is this header, but I suppose that 64bytes should by fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, you could start from 0x1FFF2800 and continue to 0x2002FFF0 with exception around 0x20000000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, in all cases it is bad idea to try rewriting memory which is currently available for allocator.&lt;/P&gt;&lt;P&gt;If you want testing memory, correct way should be allocate block as first and after that test it or test it prior you call allocator start (prior you call _mqx() function).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want allocate some memory for your own variables out of system, please modify your linker file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 12:54:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Not-able-to-access-RAM-in-MK65F180M-using-MQX/m-p/395490#M13280</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-04-17T12:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to access RAM in MK65F180M using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Not-able-to-access-RAM-in-MK65F180M-using-MQX/m-p/395491#M13281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RadekS,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your response. Sorry for my late response as I was busy with other work. I did some quick tests like you suggested and it seems working. Few things that I found from my testing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. The compiler did not optimize it to a word write.&lt;/P&gt;&lt;P&gt;2. I believe the offset of 64 bytes for allocator header and the offset for the dummy data between the boundaries of RAM did the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give me a couple more days to do further testing and if everything is OK then I will make this post answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again thanks a lot for you help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 01:21:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Not-able-to-access-RAM-in-MK65F180M-using-MQX/m-p/395491#M13281</guid>
      <dc:creator>viveksrinivasan</dc:creator>
      <dc:date>2015-04-22T01:21:24Z</dc:date>
    </item>
  </channel>
</rss>

