x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

EVT3 unknown #pragma entry

Stevetuc Page Icon Posted 2022-02-02 2:39 PM
#
Avatar image of Stevetuc
Factorite (Junior)

Posts:
35
Location:
United Kingdom
Status:
I've been studying some example files generated from Renesas High Performance Embedded Workshop (HPEW) that setup the processor to a known state on reset. It compiles for sh3 on that platform

One such file resetprg.c has a pragma directive:

 
#pragma entry PowerON_Reset 
 
Void PowerON_Reset(Void) 
{ 
...... 
} 


The help in HPEW states:

Quote
Entry Function Specification

#pragma entry[(]<function name>[)]

This specifies that the function specified as <function name> is handled as an entry function.

The entry function is created without any code to save and restore the contents of registers.


So the code in PowerON_Reset is tagged to run on a reset.

However EVT3 does not recognise the pragma
It gives unknown pragma warning.

Am I doing something wrong here, or do I have to manually
Put PowerON_Reset_PC() in the Reset Vector location?

 





Edited by Stevetuc 2022-02-02 3:09 PM
 Top of the page
Stevetuc Page Icon Posted 2022-02-02 2:51 PM
#
Avatar image of Stevetuc
Factorite (Junior)

Posts:
35
Location:
United Kingdom
Status:
Here's the appnote (admittedly for a sh7206 but similar code generated in HPEW for sh7709A)
sh7206 startup config

The reason for doing this is I want to insert some code in the manual_reset vector since it will run as privilege rather than user mode. I will then be able to read/write the FRQCR register which lives in P4 address space not available in user mode.

I wanted to code in EVT3 but looks like I'm better off in HPEW unless I can solve the pragma issue.

Edited by Stevetuc 2022-02-02 3:08 PM
 Top of the page
Alt Bass Page Icon Posted 2022-02-03 3:02 PM
#
Avatar image of Alt Bass
H/PC Sensei

Posts:
1,154
Location:
Russia
Status:
I do not see PowerON_Reset in the PDF, I only see PowerON_Reset_PC.
 Top of the page
Stevetuc Page Icon Posted 2022-02-04 2:56 PM
#
Avatar image of Stevetuc
Factorite (Junior)

Posts:
35
Location:
United Kingdom
Status:
Yes, the auto generated code for sh7709A in HPEW omits the _PC from function name but the code compiles fine in HPEW.
The issue is when trying to run in EVT3 the #pragma entry <function name> gives unknown pragma error.

My understanding is that #pragma entry <function name> should be handled by the preprocessor such that the function specified as <function name> is handled as an entry function.

So maybe something needs setting up in EVT3 for it to do this?
 Top of the page
Jump to forum:
Seconds to generate: 0.078 - Cached queries : 60 - Executed queries : 10
Server Time now is: Tuesday, 17 May 2022 - 6:18