<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: very strange issue on mcf5307</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155306#M4425</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi TomE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the help, some time is passed from my last post&amp;nbsp; on the issue, since i updated the u-boot bootloader to the most recent "git" version to see if the problem disappear, how the u-boot list guys suggested me, but it's still there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, i explain a little better how this bootloader works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the vector table (now in ram at 0x00000000) is initialized with "_int_handler" or "_exc_handler", depending if the vector is an interrupt or an exception. This is a common technique used to install later specific handlers at run time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Timer 2 is on vector dec. 31 that is correctly initialized to "_int_handler" from a "trap_init()" function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The assembly "_int_handler:" then call the proper interrupt manager function, now i have removed that code and let "rte" only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From an objdump of the code, "rte" opcode is correct, i don't see nothing special in the code that can cause this strange cpu behaviuor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing is clear, seems to be a "cpu" bad behavior, in an exception, stack frame should have the vector/format/status 32 bits information, and just after the return address, this tio have "rte" working properly. Instead actually there is the next return address in the top of the stack.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i suspect is that the timer is set up wrongly, to a too short period, or something similar, that maybe two interrupts are triggered too near, or something similar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am going on today into investigation, any idea is really appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;angelo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 31 Jul 2011 16:37:56 GMT</pubDate>
    <dc:creator>angelo_d</dc:creator>
    <dc:date>2011-07-31T16:37:56Z</dc:date>
    <item>
      <title>very strange issue on mcf5307</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155304#M4423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am running the u-boot bootlader on mcf5307, everything works, until i enable timer2 interrupt for the clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After "rte" in the interrupt handler, cpu generate the following exception:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;*** Unexpected exception ***
Vector Number: 3&amp;nbsp; Format: 04&amp;nbsp; Fault Status: 4

PC: 00fe910a&amp;nbsp;&amp;nbsp;&amp;nbsp; SR: 00002000&amp;nbsp;&amp;nbsp;&amp;nbsp; SP: 00ed8af0
D0: 00002c1b&amp;nbsp;&amp;nbsp;&amp;nbsp; D1: 0000001b&amp;nbsp;&amp;nbsp;&amp;nbsp; D2: 00400000&amp;nbsp;&amp;nbsp;&amp;nbsp; D3: 00ee8b76
D4: ffc12d08&amp;nbsp;&amp;nbsp;&amp;nbsp; D5: ffffffff&amp;nbsp;&amp;nbsp;&amp;nbsp; D6: 00ffad57&amp;nbsp;&amp;nbsp;&amp;nbsp; D7: 00ee8b76
A0: 00ee8b76&amp;nbsp;&amp;nbsp;&amp;nbsp; A1: 00fe9604&amp;nbsp;&amp;nbsp;&amp;nbsp; A2: 00ee8bc6&amp;nbsp;&amp;nbsp;&amp;nbsp; A3: 00ffd400
A4: 00ff8167&amp;nbsp;&amp;nbsp;&amp;nbsp; A5: 00ffbb00&amp;nbsp;&amp;nbsp;&amp;nbsp; A6: 00ed8b48&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this code generate the exception:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_int_handler:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rte&amp;nbsp;&amp;nbsp; &amp;lt;-----&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this code don't generate any excetion:&lt;/P&gt;&lt;P&gt;_int_handler:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is incredible, manual says clearly that on exceptions, the top of the stack is not the return address but the longword with vector/format/status values. Since "rts" works, seems top of the stack to have the return address.&lt;/P&gt;&lt;P&gt;I am really stucked and can't realize the reason for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is really appreciated.&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;P&gt;angelo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:59:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155304#M4423</guid>
      <dc:creator>angelo_d</dc:creator>
      <dc:date>2020-10-29T08:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: very strange issue on mcf5307</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155305#M4424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the address of "int_handler" the interrupt vector (in the vector table) and is "int_handler" declared with whatever magic the compiler uses to designate a function being the handler (so it saves more registers)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the code is working with an "RTS" then your "int_handler" is probably being called from another function (which is the "real" interrupt handler) or is being called from some assembly code in a file called "something.S" somewhere in the confusing U-Boot source tree.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2011 14:24:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155305#M4424</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2011-07-31T14:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: very strange issue on mcf5307</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155306#M4425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi TomE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the help, some time is passed from my last post&amp;nbsp; on the issue, since i updated the u-boot bootloader to the most recent "git" version to see if the problem disappear, how the u-boot list guys suggested me, but it's still there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, i explain a little better how this bootloader works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the vector table (now in ram at 0x00000000) is initialized with "_int_handler" or "_exc_handler", depending if the vector is an interrupt or an exception. This is a common technique used to install later specific handlers at run time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Timer 2 is on vector dec. 31 that is correctly initialized to "_int_handler" from a "trap_init()" function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The assembly "_int_handler:" then call the proper interrupt manager function, now i have removed that code and let "rte" only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From an objdump of the code, "rte" opcode is correct, i don't see nothing special in the code that can cause this strange cpu behaviuor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing is clear, seems to be a "cpu" bad behavior, in an exception, stack frame should have the vector/format/status 32 bits information, and just after the return address, this tio have "rte" working properly. Instead actually there is the next return address in the top of the stack.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i suspect is that the timer is set up wrongly, to a too short period, or something similar, that maybe two interrupts are triggered too near, or something similar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am going on today into investigation, any idea is really appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;angelo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2011 16:37:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155306#M4425</guid>
      <dc:creator>angelo_d</dc:creator>
      <dc:date>2011-07-31T16:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: very strange issue on mcf5307</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155307#M4426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after some hard time in debugging the "u-boot" reloaction code, i finally found where the problem is, even if i still don't have any solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After the SDRAM initialization, U-boot relocate his code into SDRAM, with a memory copy, and after this operation set up a new stack (%sp) into SDRAM.&lt;/P&gt;&lt;P&gt;From the assembly line just after the new stack setup, i setup and start timer2 with interrupt, and the exception on " rte" happen from now.&lt;/P&gt;&lt;P&gt;Interrupt on timer2 was working properly with the stack still in internal ram (SRAM).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, C function calls / return running from SDRAM works properly, only when an interrupt happen, the "exception" stack fill-up is wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clearly this operation made from the cpu of preparing the exception stack frame don't work properly with SDRAM.&lt;/P&gt;&lt;P&gt;I am thinking that something in the SDRAM initialization code can be wrong, even if sounds really strange, linux run perfectly running from SDRAM, with this same initialization code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;every suggestion is welcome&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;angelo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 05:32:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155307#M4426</guid>
      <dc:creator>angelo_d</dc:creator>
      <dc:date>2011-08-01T05:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: very strange issue on mcf5307</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155308#M4427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;finally, i solved it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When a cpu behavior is strangely different from what the datasheet says (after reading it carefully many time), it worth a try to see the chip ERRATA:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MCF5307ER.pdf says:&lt;/P&gt;&lt;P&gt;35 : Corrupted Return PC in Exception Stack Frame&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the workaround suggested (setting C/I bit of CS MASK register) solve the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This explain why all other coldfire models works with the same u-boot code without issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really hope this can help for who will have the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 06:08:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155308#M4427</guid>
      <dc:creator>angelo_d</dc:creator>
      <dc:date>2011-08-01T06:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: very strange issue on mcf5307</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155309#M4428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Congratulations. That is a nasty one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd take a good look at all the other errata items on that chip. It was truly unusable in the early mask versions, but there are still some errata items that could cause problems, such as (20). Can't you use a newer chip? That one is only 90MHz.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm comparing the memory control registers with the chip I'm most familiar with (MCF5329) and it only has "Address Space Masks" (including "C/I" the one that bit you) for the Static RAM. The MCF5307 has them for that, MBAR, Chip Selects and DRAM. These look like left-overs from its 68000 heritage. I don't think you want "C/I" space enabled on any of them.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Is this a bug in U-Boot? ((Google...)) I see from your post in June that you did the port. So you're responsible for it, the bug, the fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(( More Google...)) I do agree with Wolfgang, it is truly "stone age" :-):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.mail-archive.com/u-boot@lists.denx.de/msg29004.html" rel="nofollow" target="_blank"&gt;http://www.mail-archive.com/u-boot@lists.denx.de/msg29004.html&lt;/A&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 06:59:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155309#M4428</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2011-08-01T06:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: very strange issue on mcf5307</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155310#M4429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi TomE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after many year of experience in 8 bit cpu's, i decided to start a challenge for my first linux board, and chosed a Coldfire.&lt;/P&gt;&lt;P&gt;Then, since i like to start from small things to reach greater, i decided to start with one of the most simply chips where linux can run, just to make some experience. Also, since actually i solder all the prototypes here in my laboratory by hand, MCF5307 was available in QFP also &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;. So i could succeesfullt have quite easy some protptypes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://194.177.99.211/~angelo/amcore.jpg" rel="nofollow" target="_blank"&gt;http://194.177.99.211/~angelo/amcore.jpg&lt;/A&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;About the "stone-age", they was referring to the u-boot version, after updating to tha last git head. the bug was still there &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well infinite thanks for following my issue ! Hope i can be helpful to you also !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;angelo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 04:34:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/very-strange-issue-on-mcf5307/m-p/155310#M4429</guid>
      <dc:creator>angelo_d</dc:creator>
      <dc:date>2011-08-03T04:34:36Z</dc:date>
    </item>
  </channel>
</rss>

