PSoC >> PSoC Mixed-Signal Array

Pages: 1
IceCube
Tester - PRO for PSoC
***

Reged: Jun 27 2007
Posts: 86
Loc: The Netherlands
LoadConfigInit overwrites stack
      #60232 - Mon Jun 09 2008 04:06 PM Attachment (68 downloads)

At startup, before reaching main, the LoadConfigInit routine overwrites the stack and program crashes on RET instruction.

See attached screenshot.

Regards, Rolf


Post Extras: Print Post   Remind Me!   Notify Moderator  
IceCube
Tester - PRO for PSoC
***

Reged: Jun 27 2007
Posts: 86
Loc: The Netherlands
Re: LoadConfigInit overwrites stack [Re: IceCube]
      #60242 - Mon Jun 09 2008 04:10 PM Attachment (48 downloads)

Processor: CY8C27443-24PXI
HI-TECH build 2249

Project attached.

Rolf


Post Extras: Print Post   Remind Me!   Notify Moderator  
IceCube
Tester - PRO for PSoC
***

Reged: Jun 27 2007
Posts: 86
Loc: The Netherlands
Re: LoadConfigInit overwrites stack [Re: IceCube]
      #60312 - Tue Jun 10 2008 05:39 AM

Adding --reentrant solves the problem, but this is, of course not the right solution.

Regards, Rolf


Post Extras: Print Post   Remind Me!   Notify Moderator  
clydeAdministrator
HI-TECH team member
*****

Reged: Oct 16 2003
Posts: 633
Re: LoadConfigInit overwrites stack [Re: IceCube]
      #60902 - Fri Jun 13 2008 01:58 AM

Rolf, when I open this project in PD, it tells me that "The specified part is not loaded in the device library".

Is there some special SP I need for this?


Post Extras: Print Post   Remind Me!   Notify Moderator  
IceCube
Tester - PRO for PSoC
***

Reged: Jun 27 2007
Posts: 86
Loc: The Netherlands
Re: LoadConfigInit overwrites stack [Re: clyde]
      #61002 - Sat Jun 14 2008 04:16 PM

Hi Clyde,

I have no special servicepack, just V4.4 build 1884 + SP3. I tried it on another PC and it opens okay.

I have had this problem also, maybe try unpack on the local HD, and then start it from there.

Reinstalling PSoC designer may help also, or maybe try to open with V5.0 beta.

Regards, Rolf


Post Extras: Print Post   Remind Me!   Notify Moderator  
IceCube
Tester - PRO for PSoC
***

Reged: Jun 27 2007
Posts: 86
Loc: The Netherlands
Re: LoadConfigInit overwrites stack [Re: IceCube]
      #61972 - Tue Jun 24 2008 03:42 AM

Hello Clyde,

Is there any progress on this, or can I do anything?

Regards, Rolf


Post Extras: Print Post   Remind Me!   Notify Moderator  
rflores
Cypress FAE


Reged: Jul 10 2007
Posts: 52
Re: LoadConfigInit overwrites stack [Re: IceCube]
      #62192 - Wed Jun 25 2008 12:10 PM

This is fixed in PD50 (but that's not ready for prime-time yet). The problem occurs because <boot.tpl> blindly sets SP = 0x80 for HiTech before eventually calling LoadConfigInit() (which allocates a "shadow" register near 0x80 clobbering the return address on the stack). The PD44 <boot.tpl> should use the _Lstackps variable. PD44 needs fixing, but PD50 has been getting the attention for the last few months. You might try hacking <boot.tpl> per the following:

Code:
IF (TOOLCHAIN & HITECH)
;---------------------------
; Set up the Temporary stack
;---------------------------
; A temporary stack is set up for the SSC instructions.
; The real stack start will be assigned later.
;
global _Lstackps ; notify compiler of external symbol
mov A, _Lstackps ; Set top of stack to end of used RAM
swap SP, A ; This is only temporary if going to LMM
ELSE
;------------------
; Set up the stack
;------------------
mov A, __ramareas_end ; Set top of stack to end of used RAM
swap SP, A ; This is only temporary if going to LMM
ENDIF



Post Extras: Print Post   Remind Me!   Notify Moderator  
IceCube
Tester - PRO for PSoC
***

Reged: Jun 27 2007
Posts: 86
Loc: The Netherlands
Re: LoadConfigInit overwrites stack [Re: rflores]
      #62222 - Wed Jun 25 2008 04:18 PM

Okay, thanks Rick!

Post Extras: Print Post   Remind Me!   Notify Moderator  
saltisol
stranger


Reged: Jul 30 2008
Posts: 1
Re: LoadConfigInit overwrites stack [Re: IceCube]
      #67822 - Wed Jul 30 2008 08:15 AM

Hi,

I did probably run into the same problem which I have been tracing for the last two days. However, when I updated my PD 4.4 SP3 boot.tpl file, regenerated the code and re-compiled I got the following error from HI-TECH compiler:

!W ./adms.c(116):(690) interrupt function requires address (warning)
: 0: (499) undefined symbol: (error)
_Lstackps(./obj/boot.obj)

and here is the relevant part in boot.tpl:

IF (TOOLCHAIN & HITECH)
;---------------------------
; Set up the Temporary stack
;---------------------------
; A temporary stack is set up for the SSC instructions.
; The real stack start will be assigned later.
;
;;;CL;;; _stack_start: equ 80h
;;;CL;;; mov A, _stack_start ; Set top of stack to end of used RAM
global _Lstackps ; notify compiler of external symbol
mov A, _Lstackps ; Set top of stack to end of used RAM
swap SP, A ; This is only temporary if going to LMM
ELSE
;------------------
; Set up the stack
;------------------
mov A, __ramareas_end ; Set top of stack to end of used RAM
swap SP, A ; This is only temporary if going to LMM
ENDIF

(the comments I did are marked with ;;;CL;;;)


Post Extras: Print Post   Remind Me!   Notify Moderator  
clydeAdministrator
HI-TECH team member
*****

Reged: Oct 16 2003
Posts: 633
Re: LoadConfigInit overwrites stack [Re: saltisol]
      #69232 - Wed Aug 13 2008 02:11 AM

The symbol __Lstackps has two underscores at the beginning, not one.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:  ndouglas, Dan Henry, jtemples, jeff, Andrew L, mikerj, dave g, meisty, josh stevo 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 2178

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5