<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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>FX2 Crash after writing in struct</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/24384/fx2-crash-after-writing-in-struct</link><description> 
I use a Cypress Fx2. It&amp;#39;s no problem to write a value to
dcf.sekunde but if i set dcf.minute to 0 or such a other value, the
controller will stops/crash. 

 
I&amp;#39;m not sure if the struct definition is correct or if i must
reserver a address block for</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/135489?ContentTypeID=1</link><pubDate>Mon, 08 Sep 2008 07:04:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4ba2de11-888d-44d8-90b5-45c42673ef1a</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
It is quite common with:&lt;/p&gt;

&lt;pre&gt;
typedef struct tag_1 {
} tag_2;
&lt;/pre&gt;

&lt;p&gt;
tag_1 is the name it has within the &amp;quot;struct&amp;quot; namespace, i.e.:&lt;/p&gt;

&lt;pre&gt;
struct node {
    struct node* next;
    int value;
};

struct node *head;  // ok
node *tail;         // invalid - &amp;quot;struct&amp;quot; keyword needed.
&lt;/pre&gt;

&lt;p&gt;
tag_2 is the type-defined name of the struct, i.e. intended
for:&lt;/p&gt;

&lt;pre&gt;
typedef struct {
    unsigned char age;
    char* name;
} person_t;

person_t charlie;
person_t benny;
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/76645?ContentTypeID=1</link><pubDate>Mon, 08 Sep 2008 06:50:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3c6aac59-2403-4d93-92c2-7bf44ecd8545</guid><dc:creator>Jack Sprat</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;I could start looking, but here is a chance for Mr. Smoked
Sardine who claims to know (where in) the C standard regarding such
(is) to be helpful for a change.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Adhering to the give a man a fish.... philosopy I think it would
be an excellent exercise for you to open up that lovely new copy of
the &amp;#39;C&amp;#39; standard you&amp;#39;ve just bought and take a look yourself.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;All I can say is I have never seen the dual naming seen
above.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I see.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;typedef xdata struct {&lt;br /&gt;
....&lt;br /&gt;
}tdcf;&lt;br /&gt;
is the &amp;#39;normal&amp;#39; construct&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I&amp;#39;m not sure I&amp;#39;m familiar with your definition of &amp;#39;normal&amp;#39;.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/124897?ContentTypeID=1</link><pubDate>Sat, 06 Sep 2008 05:13:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ab48fdec-c7dc-4ca1-b49f-05df5338d1c2</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Locking a lot of things down to absolute addresses can quickly
become problematic.&lt;/p&gt;

&lt;p&gt;
Sometimes it can be good to produce a &amp;quot;list-of-lists&amp;quot;. One single
data structure that contains the address and size of other
structures.&lt;/p&gt;

&lt;p&gt;
Another thing to think about is that the structure may change
depending on version. Knowing where it is doesn&amp;#39;t imply that you know
enough about its contents to really know how to read/write it.&lt;/p&gt;

&lt;p&gt;
Priority one must be a method to let the PC know what firmware
version you have in your device.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/114228?ContentTypeID=1</link><pubDate>Sat, 06 Sep 2008 05:07:31 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:39881f9c-feed-471a-8c0b-1dabaac0057d</guid><dc:creator>Thomas F.</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;quot;Why would that be necessary for an internal RAM data object?&amp;quot;&lt;/p&gt;

&lt;p&gt;
Not for the internal Ram but in the extern Ram it will be easier
to read and write via usb vom a pc, if you now the address.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/114215?ContentTypeID=1</link><pubDate>Fri, 05 Sep 2008 10:00:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1b07b028-b192-4d51-a2c1-065e28ccd77e</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;quot;for normal variables&amp;quot;&lt;/p&gt;

&lt;p&gt;
A struct _is_ a normal variable.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/101044?ContentTypeID=1</link><pubDate>Fri, 05 Sep 2008 09:32:27 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d1ca14dc-b835-49dc-aeb5-4108df7d3d9d</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;How can I define on which address the struct will be created
?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Why would that be necessary for an internal RAM data object?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/92090?ContentTypeID=1</link><pubDate>Fri, 05 Sep 2008 08:35:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:15acff30-0a22-4ebc-9fb2-246b232d38e6</guid><dc:creator>Thomas F.</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thx&amp;#39;s for your information.&lt;br /&gt;
Now it is a little bit clearer. To remove the Problem I switch to
internal ram by removing &amp;quot;xdata&amp;quot;.&lt;/p&gt;

&lt;p&gt;
How can I define on which address the struct will be created
??&lt;/p&gt;

&lt;p&gt;
for normal variables:&lt;/p&gt;

&lt;pre&gt;
xdata unsigned char xOverflowCounter2      _at_ 0xE038;
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/52366?ContentTypeID=1</link><pubDate>Fri, 05 Sep 2008 07:05:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:380cdb26-afe0-4cbb-b798-585a6d170fba</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;I&amp;#39;m not sure if the struct definition is correct ...&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Since types do not occupy memory, it&amp;#39;s not very meaningful for
them to have a memory space specifier. It&amp;#39;s more meaningful for
allocated data objects to have the memory space specifier.&lt;/p&gt;

&lt;p&gt;
FX2_DCF-Clock.h&lt;/p&gt;

&lt;pre&gt;
typedef struct signal {
    unsigned char sekunde;
    unsigned char minute;
    unsigned char stunde;
    unsigned char tag;
    unsigned char wochentag;
    unsigned char monat;
    unsigned char jahr;
    unsigned char synkro;
    unsigned int  fehler_zaehler;
}tdcf;

extern tdcf xdata dcf;
&lt;/pre&gt;

&lt;p&gt;
FX2_DCF-Clock.c&lt;/p&gt;

&lt;pre&gt;
tdcf xdata dcf;
&lt;/pre&gt;

&lt;p&gt;
Your typedef does two things; defines &amp;#39;struct signal&amp;#39; and defines
a new type (alias) for &amp;#39;struct signal&amp;#39; named &amp;#39;tdcf&amp;#39;. The structure
tag (&amp;#39;signal&amp;#39;) and the typedef name &amp;#39;tdcf&amp;#39; are separate things.
Combining the way you have done is legitimate.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/101042?ContentTypeID=1</link><pubDate>Fri, 05 Sep 2008 06:53:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:44b41315-e317-4c8f-8adf-133ce7bbb482</guid><dc:creator>Catcus Blip</dc:creator><description>&lt;p&gt;&lt;p&gt;
is your struct mapped to a peripheral?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/92089?ContentTypeID=1</link><pubDate>Fri, 05 Sep 2008 06:49:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e58c0aa8-8293-48ff-8cd5-aa2b3c0785d5</guid><dc:creator>Thomas F.</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thx for your fast reply.&lt;/p&gt;

&lt;p&gt;
I change it to &amp;quot;typedef xdata struct{&amp;quot;, but there is no
effect.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 Crash after writing in struct</title><link>https://community.arm.com/thread/52365?ContentTypeID=1</link><pubDate>Fri, 05 Sep 2008 06:19:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:822b5bcf-fdc2-4416-bf1a-7239b7f40ab0</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;typedef xdata struct &lt;b&gt;signal&lt;/b&gt; {&lt;br /&gt;
....&lt;br /&gt;
}&lt;b&gt;tdcf&lt;/b&gt;;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I could start looking, but here is a chance for Mr. Smoked Sardine
who claims to know (where in) the C standard regarding such (is) to
be helpful for a change.&lt;/p&gt;

&lt;p&gt;
All I can say is I have never seen the dual naming seen above.&lt;/p&gt;

&lt;p&gt;
typedef xdata struct {&lt;br /&gt;
....&lt;br /&gt;
}tdcf;&lt;br /&gt;
is the &amp;#39;normal&amp;#39; construct&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>