Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » SDCC
  • » [Sdcc-user] Cypress FX2LP - problem after upgrading from sdcc-2.6.0 [RSS Feed]

#1 March 25, 2008 20:54:21

Maarten B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] Cypress FX2LP - problem after upgrading from sdcc-2.6.0


Hello Steven,

What does sdcc put at 0x0000? See .map file or other
.rst files. What options did you use to compile and link
this? Are you using separate .asm files with incomplete
.area directives?

Maarten

> Greetings All,
>
> sdcc-2.6.0 was successfully compiling code for a Cypress FX2LP chip until
> it hit this bug - SIGSEGV using auto variable.
>
> This spurred me to upgrade to sdcc-2.8.0 (currently using #5117). However,
> since doing that, I've come across another problem. The code is loaded
> successfully into the FX2LP, but after reset, it behaves unpredictably -
> often not renumerating properly and thus not appearing on the USB bus.
>
> Rolling back to a previous version of my code allows sdcc-2.6.0 to compile
> it without the SIGSEGV using auto variable problem. This previous version
> of my code still exhibits the second problem when compiling with
> sdcc-2.8.0. This allows comparison between the output of the two sdcc
> versions.
>
> There is a difference between the main .rst files as follows:
>
> sdcc-2.6.0:
> 438 .area HOME (CODE)
> 0000 439 __interrupt_vect:
> 0000 02 00 67 440 ljmp __sdcc_gsinit_startup
>
> sdcc-2.8.0:
> 447 .area HOME (CODE)
> 0064 448 __interrupt_vect:
> 0064 02 00 6C 449 ljmp __sdcc_gsinit_startup
>
>
> I assume that HOME is meant to be the start of the code segment and that it
> should start at address 0000? Why does sdcc-2.8.0 start the interrupt
> vector table at 0064? Am I misunderstanding something?
>
> Any other pointers for where I can look to solve this problem would be
> greatly appreciated.
>
> Thanks
> Steven


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#2 March 26, 2008 17:49:59

Maarten B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] Cypress FX2LP - problem after upgrading from sdcc-2.6.0


Steven,

Do you really need the interrupt vectors in asm? If so I recommend to add
the bootvector at 0x0000 to it as a solution. Messing with only some of
the vectors is dangerous.

The compiler puts the bootvector in segment HOME, but also puts interrupt
vectors (if any) and some initialization code there. This makes HOME
larger than 3 bytes. After the absolute segment VECTORS has been placed,
the linker can no longer put HOME in the first 3 bytes and moves to the
first empty place at 0x0064.

Maarten

> Hello Maarten,
>
> I have attached trimmed versions (to keep this email under the 40k limit)
> of the map files from 2.6.0 and 2.8.0.
>
> I used the same Makefile for both versions - the compiler and linker
> options are:
>
> CFLAGS= --nogcse --noinvariant --noinduction --nojtbound --noloopreverse
> --nolabelopt --no-xinit-opt --nooverlay --no-peep -DALLOCATE_REGISTERS
>
> LDFLAGS=--nogcse --noinvariant --noinduction --nojtbound --noloopreverse
> --nolabelopt --no-xinit-opt --nooverlay --no-peep \
> --iram-size 256 --xram-loc 0x3000
>
> I have 3 separate asm files. They have these .area directives:
>
> 1. For interrupt vectors:
> .area VECTORS (CODE,ABS)
> .org 0x03
>
> 2. For USB-interrupt autovectors jump table:
> .area USBJT (CODE,ABS)
> .org 0x1a00
>
> 3. For descriptor table:
> .area DSCR (CODE,ABS)
> .org 0x1f00
>
> I can see from the vectors.rst file that the interrupt vectors start at
> 0x0003, but I can't see anywhere in the other rst files from 2.8.0 what
> code there is at 0x0000. I can send you the rst files if needed.
>
> I've been battling with this for days and am pretty lost, so any help
> would
> be greatly appreciated.
>
> Many thanks,
> Steven
>
> Maarten Brock wrote:
>> Hello Steven,
>>
>> What does sdcc put at 0x0000? See .map file or other
>> .rst files. What options did you use to compile and link
>> this? Are you using separate .asm files with incomplete
>> .area directives?
>>
>> Maarten
>>
>>> Greetings All,
>>>
>>> sdcc-2.6.0 was successfully compiling code for a Cypress FX2LP chip
>>> until
>>> it hit this bug - SIGSEGV using auto variable.
>>>
>>> This spurred me to upgrade to sdcc-2.8.0 (currently using #5117).
>>> However,
>>> since doing that, I've come across another problem. The code is loaded
>>> successfully into the FX2LP, but after reset, it behaves unpredictably
>>> -
>>> often not renumerating properly and thus not appearing on the USB bus.
>>>
>>> Rolling back to a previous version of my code allows sdcc-2.6.0 to
>>> compile
>>> it without the SIGSEGV using auto variable problem. This previous
>>> version
>>> of my code still exhibits the second problem when compiling with
>>> sdcc-2.8.0. This allows comparison between the output of the two sdcc
>>> versions.
>>>
>>> There is a difference between the main .rst files as follows:
>>>
>>> sdcc-2.6.0:
>>> 438 .area HOME (CODE)
>>> 0000 439 __interrupt_vect:
>>> 0000 02 00 67 440 ljmp __sdcc_gsinit_startup
>>>
>>> sdcc-2.8.0:
>>> 447 .area HOME (CODE)
>>> 0064 448 __interrupt_vect:
>>> 0064 02 00 6C 449 ljmp __sdcc_gsinit_startup
>>>
>>>
>>> I assume that HOME is meant to be the start of the code segment and
>>> that it
>>> should start at address 0000? Why does sdcc-2.8.0 start the interrupt
>>> vector table at 0064? Am I misunderstanding something?
>>>
>>> Any other pointers for where I can look to solve this problem would be
>>> greatly appreciated.
>>>
>>> Thanks
>>> Steven
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
>http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________> Sdcc-user mailing list
> Sdcc-u***@*ists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/sdcc-user>


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#3 March 26, 2008 18:38:36

Maarten B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] Cypress FX2LP - problem after upgrading from sdcc-2.6.0


Steven,

I probably changed that somehwere after 2.6.0 in order to make sure the
startup code would never end up in a bank when using bank switching. In my
opinion segment HOME should contain code that must stay in the common bank
when using bank switched code memory.

It's still on my wishlist to change all this vector stuff so you don't
need to put ISR prototypes next to main() anymore. All vectors will
probably be located absolute then, including the bootvector.

Maarten

> Hi Maarten,
>
> Sorry, I missed your reply before my last post.
>
> I'll try what you suggest, but do you know why there would be a change
> since 2.6.0? I remember trying 2.7.0 at one stage and had this problem,
> so
> reverted to 2.6.0 until I hit the SIGSEGV using auto variable bug.
>
> Thanks
> Steven
>
> Maarten Brock wrote:
>> Steven,
>>
>> Do you really need the interrupt vectors in asm? If so I recommend to
>> add
>> the bootvector at 0x0000 to it as a solution. Messing with only some of
>> the vectors is dangerous.
>>
>> The compiler puts the bootvector in segment HOME, but also puts
>> interrupt
>> vectors (if any) and some initialization code there. This makes HOME
>> larger than 3 bytes. After the absolute segment VECTORS has been placed,
>> the linker can no longer put HOME in the first 3 bytes and moves to the
>> first empty place at 0x0064.
>>
>> Maarten
>>
>>> Hello Maarten,
>>>
>>> I have attached trimmed versions (to keep this email under the 40k
>>> limit)
>>> of the map files from 2.6.0 and 2.8.0.
>>>
>>> I used the same Makefile for both versions - the compiler and linker
>>> options are:
>>>
>>> CFLAGS= --nogcse --noinvariant --noinduction --nojtbound
>>> --noloopreverse
>>> --nolabelopt --no-xinit-opt --nooverlay --no-peep -DALLOCATE_REGISTERS
>>>
>>> LDFLAGS=--nogcse --noinvariant --noinduction --nojtbound
>>> --noloopreverse
>>> --nolabelopt --no-xinit-opt --nooverlay --no-peep \
>>> --iram-size 256 --xram-loc 0x3000
>>>
>>> I have 3 separate asm files. They have these .area directives:
>>>
>>> 1. For interrupt vectors:
>>> .area VECTORS (CODE,ABS)
>>> .org 0x03
>>>
>>> 2. For USB-interrupt autovectors jump table:
>>> .area USBJT (CODE,ABS)
>>> .org 0x1a00
>>>
>>> 3. For descriptor table:
>>> .area DSCR (CODE,ABS)
>>> .org 0x1f00
>>>
>>> I can see from the vectors.rst file that the interrupt vectors start at
>>> 0x0003, but I can't see anywhere in the other rst files from 2.8.0 what
>>> code there is at 0x0000. I can send you the rst files if needed.
>>>
>>> I've been battling with this for days and am pretty lost, so any help
>>> would
>>> be greatly appreciated.
>>>
>>> Many thanks,
>>> Steven
>>>
>>> Maarten Brock wrote:
>>>> Hello Steven,
>>>>
>>>> What does sdcc put at 0x0000? See .map file or other
>>>> .rst files. What options did you use to compile and link
>>>> this? Are you using separate .asm files with incomplete
>>>> .area directives?
>>>>
>>>> Maarten
>>>>
>>>>> Greetings All,
>>>>>
>>>>> sdcc-2.6.0 was successfully compiling code for a Cypress FX2LP chip
>>>>> until
>>>>> it hit this bug - SIGSEGV using auto variable.
>>>>>
>>>>> This spurred me to upgrade to sdcc-2.8.0 (currently using #5117).
>>>>> However,
>>>>> since doing that, I've come across another problem. The code is
>>>>> loaded
>>>>> successfully into the FX2LP, but after reset, it behaves
>>>>> unpredictably
>>>>> -
>>>>> often not renumerating properly and thus not appearing on the USB
>>>>> bus.
>>>>>
>>>>> Rolling back to a previous version of my code allows sdcc-2.6.0 to
>>>>> compile
>>>>> it without the SIGSEGV using auto variable problem. This previous
>>>>> version
>>>>> of my code still exhibits the second problem when compiling with
>>>>> sdcc-2.8.0. This allows comparison between the output of the two
>>>>> sdcc
>>>>> versions.
>>>>>
>>>>> There is a difference between the main .rst files as follows:
>>>>>
>>>>> sdcc-2.6.0:
>>>>> 438 .area HOME (CODE)
>>>>> 0000 439 __interrupt_vect:
>>>>> 0000 02 00 67 440 ljmp __sdcc_gsinit_startup
>>>>>
>>>>> sdcc-2.8.0:
>>>>> 447 .area HOME (CODE)
>>>>> 0064 448 __interrupt_vect:
>>>>> 0064 02 00 6C 449 ljmp __sdcc_gsinit_startup
>>>>>
>>>>>
>>>>> I assume that HOME is meant to be the start of the code segment and
>>>>> that it
>>>>> should start at address 0000? Why does sdcc-2.8.0 start the
>>>>> interrupt
>>>>> vector table at 0064? Am I misunderstanding something?
>>>>>
>>>>> Any other pointers for where I can look to solve this problem would
>>>>> be
>>>>> greatly appreciated.
>>>>>
>>>>> Thanks
>>>>> Steven
>>>
>>> -------------------------------------------------------------------------
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>>http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________>>> Sdcc-user mailing list
>>> Sdcc-u***@*ists.sourceforge.net
>>>https://lists.sourceforge.net/lists/listinfo/sdcc-user>>>
>>
>>
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>>http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace>> _______________________________________________
>> Sdcc-user mailing list
>> Sdcc-u***@*ists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/sdcc-user>>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
>http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace> _______________________________________________
> Sdcc-user mailing list
> Sdcc-u***@*ists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/sdcc-user>
>


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#4 March 27, 2008 08:46:38

Steven P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] Cypress FX2LP - problem after upgrading from sdcc-2.6.0


Maarten,

I have added a bootvector as per your suggestion and it works 100%.

Thanks very much for your help!

Kind regards,
Steven


Maarten Brock wrote:
> Steven,
>
> I probably changed that somehwere after 2.6.0 in order to make sure the
> startup code would never end up in a bank when using bank switching. In my
> opinion segment HOME should contain code that must stay in the common bank
> when using bank switched code memory.
>
> It's still on my wishlist to change all this vector stuff so you don't
> need to put ISR prototypes next to main() anymore. All vectors will
> probably be located absolute then, including the bootvector.
>
> Maarten
>
>> Hi Maarten,
>>
>> Sorry, I missed your reply before my last post.
>>
>> I'll try what you suggest, but do you know why there would be a change
>> since 2.6.0? I remember trying 2.7.0 at one stage and had this problem,
>> so
>> reverted to 2.6.0 until I hit the SIGSEGV using auto variable bug.
>>
>> Thanks
>> Steven
>>
>> Maarten Brock wrote:
>>> Steven,
>>>
>>> Do you really need the interrupt vectors in asm? If so I recommend to
>>> add
>>> the bootvector at 0x0000 to it as a solution. Messing with only some of
>>> the vectors is dangerous.
>>>
>>> The compiler puts the bootvector in segment HOME, but also puts
>>> interrupt
>>> vectors (if any) and some initialization code there. This makes HOME
>>> larger than 3 bytes. After the absolute segment VECTORS has been placed,
>>> the linker can no longer put HOME in the first 3 bytes and moves to the
>>> first empty place at 0x0064.
>>>
>>> Maarten
>>>
>>>> Hello Maarten,
>>>>
>>>> I have attached trimmed versions (to keep this email under the 40k
>>>> limit)
>>>> of the map files from 2.6.0 and 2.8.0.
>>>>
>>>> I used the same Makefile for both versions - the compiler and linker
>>>> options are:
>>>>
>>>> CFLAGS= --nogcse --noinvariant --noinduction --nojtbound
>>>> --noloopreverse
>>>> --nolabelopt --no-xinit-opt --nooverlay --no-peep -DALLOCATE_REGISTERS
>>>>
>>>> LDFLAGS=--nogcse --noinvariant --noinduction --nojtbound
>>>> --noloopreverse
>>>> --nolabelopt --no-xinit-opt --nooverlay --no-peep \
>>>> --iram-size 256 --xram-loc 0x3000
>>>>
>>>> I have 3 separate asm files. They have these .area directives:
>>>>
>>>> 1. For interrupt vectors:
>>>> .area VECTORS (CODE,ABS)
>>>> .org 0x03
>>>>
>>>> 2. For USB-interrupt autovectors jump table:
>>>> .area USBJT (CODE,ABS)
>>>> .org 0x1a00
>>>>
>>>> 3. For descriptor table:
>>>> .area DSCR (CODE,ABS)
>>>> .org 0x1f00
>>>>
>>>> I can see from the vectors.rst file that the interrupt vectors start at
>>>> 0x0003, but I can't see anywhere in the other rst files from 2.8.0 what
>>>> code there is at 0x0000. I can send you the rst files if needed.
>>>>
>>>> I've been battling with this for days and am pretty lost, so any help
>>>> would
>>>> be greatly appreciated.
>>>>
>>>> Many thanks,
>>>> Steven
>>>>
>>>> Maarten Brock wrote:
>>>>> Hello Steven,
>>>>>
>>>>> What does sdcc put at 0x0000? See .map file or other
>>>>> .rst files. What options did you use to compile and link
>>>>> this? Are you using separate .asm files with incomplete
>>>>> .area directives?
>>>>>
>>>>> Maarten
>>>>>
>>>>>> Greetings All,
>>>>>>
>>>>>> sdcc-2.6.0 was successfully compiling code for a Cypress FX2LP chip
>>>>>> until
>>>>>> it hit this bug - SIGSEGV using auto variable.
>>>>>>
>>>>>> This spurred me to upgrade to sdcc-2.8.0 (currently using #5117).
>>>>>> However,
>>>>>> since doing that, I've come across another problem. The code is
>>>>>> loaded
>>>>>> successfully into the FX2LP, but after reset, it behaves
>>>>>> unpredictably
>>>>>> -
>>>>>> often not renumerating properly and thus not appearing on the USB
>>>>>> bus.
>>>>>>
>>>>>> Rolling back to a previous version of my code allows sdcc-2.6.0 to
>>>>>> compile
>>>>>> it without the SIGSEGV using auto variable problem. This previous
>>>>>> version
>>>>>> of my code still exhibits the second problem when compiling with
>>>>>> sdcc-2.8.0. This allows comparison between the output of the two
>>>>>> sdcc
>>>>>> versions.
>>>>>>
>>>>>> There is a difference between the main .rst files as follows:
>>>>>>
>>>>>> sdcc-2.6.0:
>>>>>> 438 .area HOME (CODE)
>>>>>> 0000 439 __interrupt_vect:
>>>>>> 0000 02 00 67 440 ljmp __sdcc_gsinit_startup
>>>>>>
>>>>>> sdcc-2.8.0:
>>>>>> 447 .area HOME (CODE)
>>>>>> 0064 448 __interrupt_vect:
>>>>>> 0064 02 00 6C 449 ljmp __sdcc_gsinit_startup
>>>>>>
>>>>>>
>>>>>> I assume that HOME is meant to be the start of the code segment and
>>>>>> that it
>>>>>> should start at address 0000? Why does sdcc-2.8.0 start the
>>>>>> interrupt
>>>>>> vector table at 0064? Am I misunderstanding something?
>>>>>>
>>>>>> Any other pointers for where I can look to solve this problem would
>>>>>> be
>>>>>> greatly appreciated.
>>>>>>
>>>>>> Thanks
>>>>>> Steven
>>>> -------------------------------------------------------------------------
>>>> Check out the new SourceForge.net Marketplace.
>>>> It's the best place to buy or sell services for
>>>> just about anything Open Source.
>>>>http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________>>>> Sdcc-user mailing list
>>>> Sdcc-u***@*ists.sourceforge.net
>>>>https://lists.sourceforge.net/lists/listinfo/sdcc-user>>>>
>>>
>>> -------------------------------------------------------------------------
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>>http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace>>> _______________________________________________
>>> Sdcc-user mailing list
>>> Sdcc-u***@*ists.sourceforge.net
>>>https://lists.sourceforge.net/lists/listinfo/sdcc-user>>>
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>>http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace>> _______________________________________________
>> Sdcc-user mailing list
>> Sdcc-u***@*ists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/sdcc-user>>
>>
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
>http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace> _______________________________________________
> Sdcc-user mailing list
> Sdcc-u***@*ists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/sdcc-user>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

  • Root
  • » SDCC
  • » [Sdcc-user] Cypress FX2LP - problem after upgrading from sdcc-2.6.0 [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support