<?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: Bare-metal app: copy big data from memory to array in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Bare-metal-app-copy-big-data-from-memory-to-array/m-p/262638#M26645</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably you already got it solved but let me shoot some ideas:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, is &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;IMAGE_BUFFER_BASE_ADDRESS&lt;/SPAN&gt; a valid address? was this allocated somewhere? have access through MMU, have you tried accessing (read/write) with the CPU?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly: memcpy with CPU is very simple, you can do it your own to debug more easily:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int8U ptr1;ptr2;&lt;/P&gt;&lt;P&gt;ptr1 = buf;&lt;/P&gt;&lt;P&gt;ptr2= &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;IMAGE_BUFFER_BASE_ADDRESS&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;for(i=0; i&amp;lt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;IMAGE_FRAME_SIZE&lt;/SPAN&gt;; i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;ptr1[i] = ptr2[i];&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run the code above and check where it fails... if it fails at the begining, is very likely your memory is not being correctly allocated or addressed (ie. &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;IMAGE_BUFFER_BASE_ADDRESS&lt;/SPAN&gt; is invalid address)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jun 2013 14:05:37 GMT</pubDate>
    <dc:creator>ioseph_martinez</dc:creator>
    <dc:date>2013-06-12T14:05:37Z</dc:date>
    <item>
      <title>Bare-metal app: copy big data from memory to array</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Bare-metal-app-copy-big-data-from-memory-to-array/m-p/262637#M26644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have an image buffer in the memory and I want to read each frame at one time by using memcpy to copy from memory to an 3 dimensions array with size 82x62x3 but the program stuck at the call of memcpy function.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;Int8U buf[82][62][3];&lt;/P&gt;&lt;P&gt;memcpy(buf, (Int8U *)IMAGE_BUFFER_BASE_ADDRESS, IMAGE_FRAME_SIZE);&lt;/P&gt;&lt;P&gt;(where IMAGE_FRAME_SIZE=82x62x3=15252 bytes)&lt;/P&gt;&lt;P&gt;Could you give me any suggestion?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 13:26:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Bare-metal-app-copy-big-data-from-memory-to-array/m-p/262637#M26644</guid>
      <dc:creator>thuanpham</dc:creator>
      <dc:date>2013-04-11T13:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Bare-metal app: copy big data from memory to array</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Bare-metal-app-copy-big-data-from-memory-to-array/m-p/262638#M26645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably you already got it solved but let me shoot some ideas:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, is &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;IMAGE_BUFFER_BASE_ADDRESS&lt;/SPAN&gt; a valid address? was this allocated somewhere? have access through MMU, have you tried accessing (read/write) with the CPU?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly: memcpy with CPU is very simple, you can do it your own to debug more easily:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int8U ptr1;ptr2;&lt;/P&gt;&lt;P&gt;ptr1 = buf;&lt;/P&gt;&lt;P&gt;ptr2= &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;IMAGE_BUFFER_BASE_ADDRESS&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;for(i=0; i&amp;lt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;IMAGE_FRAME_SIZE&lt;/SPAN&gt;; i++)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;ptr1[i] = ptr2[i];&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run the code above and check where it fails... if it fails at the begining, is very likely your memory is not being correctly allocated or addressed (ie. &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;IMAGE_BUFFER_BASE_ADDRESS&lt;/SPAN&gt; is invalid address)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 14:05:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Bare-metal-app-copy-big-data-from-memory-to-array/m-p/262638#M26645</guid>
      <dc:creator>ioseph_martinez</dc:creator>
      <dc:date>2013-06-12T14:05:37Z</dc:date>
    </item>
  </channel>
</rss>

