Andes Workshop

It is currently Thu Mar 28, 2024 8:57 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Andes C Language Extension for ISR
PostPosted: Tue Jan 21, 2014 6:15 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
How to enable DLM when reset?

-----------
Please reference the note of "Andes Programming Guide" 10.1.

_nds32_init_mem(): the name of memory initialization function; called by 1st level reset handler. User must implement this callback function if the memory in the target system needs to be initialized by software. One of the examples of such memory is DRAM.

Prototype: void _nds32_init_mem(void) __attribute__((no_prologue))

Example:
void _nds32_init_mem(void) __attribute__((no_prologue, optimize("Os")));
void _nds32_init_mem(void) //The function is weak (optional)
{
__nds32__mtsr((0x10000|0x01), NDS32_SR_DLMB); //enable DLM base address & size=32K
__nds32__dsb();

}

Note: After boot, the $sp is zero, it can work well.
(If $sp is not equal to zero, it doesn't go to initialize steps)

In AndeSight user manual, it mentions:
3.2.3.7
C-extension for ISR
This demo program (demo-int-c-ext) not only demonstrates interrupt service routine as demo-int does but also serves as an example of how to write ISR with C-extension. In the program, crto.S and interrupt.h in interrupt-c-ext.c are written in C language.

NOTE: When this program is built with load mode, users need to set $sp to 0 through debugger before running it.


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group