<?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>CodeWarrior for MCUのトピックRe: change reset vector function</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182539#M6229</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mike,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you created a new project using the wizard, you are provided with a basic framework for the file main.c, which incorporates the function main().&amp;nbsp; This&amp;nbsp;function is equivalent to the initialisation sequence, followed by a non-exiting loop that you would also have in an assembly project.&amp;nbsp; Within the file Start08.c is the _Startup() function that is normally referenced by the reset vector, and this will exit by doing a direct jump to main().&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_Startup() basically does two things.&amp;nbsp; It&amp;nbsp;provides "copydown" of initialisation values for global and static variables, and it initialises the stack pointer.&amp;nbsp; When you create a new project, you are given the choice of either ANSI initialisation, or minimal initialisation.&amp;nbsp; With the latter selection,&amp;nbsp;the copydown process&amp;nbsp;is eliminated, leaving only the initialisation of the stack pointer prior to jumping to main().&amp;nbsp; It is not a good idea to&amp;nbsp;bypass the initialisation of the stack pointer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will notice that the top of file main.c there is an #include derivative.h.&amp;nbsp; This file, in turn, #includes the actual header file for the MCU derivative that you are using, and this is already incorporated within the project structure.&amp;nbsp; This identifies all the MCU register names, and their associated individual bits.&amp;nbsp; derivative.h should be #included at the top of any other .c&amp;nbsp;file that&amp;nbsp;manipulates MCU registers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MCU header file contains many&amp;nbsp;examples where, obviously, a particular register needs to be&amp;nbsp;associated with a specific address.&amp;nbsp; It is also possible for the linker to place a function at a specific address if a special segment is created for that function (see documentation for .PRM file).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached some basic C tutorial information obtained from the web some time ago.&amp;nbsp; Google will probably find numerous other examples.&amp;nbsp; There is also the publication "HCS08 Unleashed' by Fabio Pereira,&amp;nbsp;that contains a multitude of programming examples in C, and directly relates to an earlier version of CodeWarrior.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2012 22:33:56 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2012-07-24T22:33:56Z</dc:date>
    <item>
      <title>change reset vector function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182536#M6226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CW6.1&lt;/P&gt;&lt;P&gt;brand new project in "C"&lt;/P&gt;&lt;P&gt;open .prm file and change reset vector to:&lt;/P&gt;&lt;P&gt;"VECTOR 0 _Entry" instead of "VECTOR 0 _Startup"&lt;/P&gt;&lt;P&gt;i delete the Start08.c file all together.&lt;/P&gt;&lt;P&gt;in main.c i add the function "void _Entry(void){/*do stuff*/}"&lt;/P&gt;&lt;P&gt;when i MAKE the project i get the error:&lt;/P&gt;&lt;P&gt;"Link Error: L1115 Function _Startup not found"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WHY is it still looking for "_Startup" and not "_Entry" ???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 19:52:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182536#M6226</guid>
      <dc:creator>LiveMike</dc:creator>
      <dc:date>2012-07-24T19:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: change reset vector function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182537#M6227</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;INIT _Entry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to your linker . prm file.&lt;/P&gt;&lt;P&gt;See 'User-Defined Startup Routines" in the Build_Tools_Utiliites.pdf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;BK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 20:01:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182537#M6227</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2012-07-24T20:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: change reset vector function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182538#M6228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks BK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have so many questions though. &amp;nbsp;We have been using Assembly for decades, and now are switching to C. &amp;nbsp;Not fun. &amp;nbsp;In Assembly, we had one file, main.asm. &amp;nbsp;Initialization, decalration of registers, the main loop, subroutines, and vectors. &amp;nbsp;There was a .prm linker file, and that's it. &amp;nbsp;I feel like in C there are so many "extra" files, and NOTHING is organized. &amp;nbsp;I want to use C but I feel like I don't know where to start. &amp;nbsp;I don't understand the #pragma at all, I know it's for the compiler, but Assembly wasn't anywhere near this complicated. &amp;nbsp;If I create a new blank "C" project, where do I define my "registers"? &amp;nbsp;How do I make them 8 bit registers? &amp;nbsp;What is the equivalent of "ORG" statements? &amp;nbsp;I'm still trying to figure out "global" variables in C and header files etc. &amp;nbsp;(By the way, it's not the C language, it's the application of it.) &amp;nbsp;Do you have some links or references that explain the basics for beginners? &amp;nbsp;And I know most will say, stop trying to "edit" everything, just create your program in "main". &amp;nbsp;The problem is I can't ship out devices without knowing what exactly every line of code does. &amp;nbsp;Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 20:42:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182538#M6228</guid>
      <dc:creator>LiveMike</dc:creator>
      <dc:date>2012-07-24T20:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: change reset vector function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182539#M6229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mike,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you created a new project using the wizard, you are provided with a basic framework for the file main.c, which incorporates the function main().&amp;nbsp; This&amp;nbsp;function is equivalent to the initialisation sequence, followed by a non-exiting loop that you would also have in an assembly project.&amp;nbsp; Within the file Start08.c is the _Startup() function that is normally referenced by the reset vector, and this will exit by doing a direct jump to main().&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_Startup() basically does two things.&amp;nbsp; It&amp;nbsp;provides "copydown" of initialisation values for global and static variables, and it initialises the stack pointer.&amp;nbsp; When you create a new project, you are given the choice of either ANSI initialisation, or minimal initialisation.&amp;nbsp; With the latter selection,&amp;nbsp;the copydown process&amp;nbsp;is eliminated, leaving only the initialisation of the stack pointer prior to jumping to main().&amp;nbsp; It is not a good idea to&amp;nbsp;bypass the initialisation of the stack pointer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will notice that the top of file main.c there is an #include derivative.h.&amp;nbsp; This file, in turn, #includes the actual header file for the MCU derivative that you are using, and this is already incorporated within the project structure.&amp;nbsp; This identifies all the MCU register names, and their associated individual bits.&amp;nbsp; derivative.h should be #included at the top of any other .c&amp;nbsp;file that&amp;nbsp;manipulates MCU registers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MCU header file contains many&amp;nbsp;examples where, obviously, a particular register needs to be&amp;nbsp;associated with a specific address.&amp;nbsp; It is also possible for the linker to place a function at a specific address if a special segment is created for that function (see documentation for .PRM file).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached some basic C tutorial information obtained from the web some time ago.&amp;nbsp; Google will probably find numerous other examples.&amp;nbsp; There is also the publication "HCS08 Unleashed' by Fabio Pereira,&amp;nbsp;that contains a multitude of programming examples in C, and directly relates to an earlier version of CodeWarrior.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 22:33:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182539#M6229</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2012-07-24T22:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: change reset vector function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182540#M6230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WOW bigmac!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, very informative and educational, and easy to understand. &amp;nbsp;I've been programming java, htlm, xml, css, javascript, php, blah blah blah forever (10 years lol) but this microcontoller stuff seems MORE complex, haha. &amp;nbsp;thanks for the attachemnts and i'll deff look into that "HCS08 unleashed" publication.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 00:33:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/change-reset-vector-function/m-p/182540#M6230</guid>
      <dc:creator>LiveMike</dc:creator>
      <dc:date>2012-07-25T00:33:14Z</dc:date>
    </item>
  </channel>
</rss>

