Andes Workshop

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

All times are UTC + 8 hours [ DST ]


Search found 487 matches
Search these results:

Author Message

 Forum: Programming   Topic: Assign static library to specific address

Posted: Sat Aug 02, 2014 10:57 pm 

Replies: 1
Views: 8503


Another sample code
Attachment:
usercode2.zip [46.45 KiB]
Downloaded 767 times


Output message:
Attachment:
5.png
5.png [ 17.25 KiB | Viewed 8499 times ]

 Forum: Programming   Topic: Assign static library to specific address

Posted: Sat Aug 02, 2014 10:28 pm 

Replies: 1
Views: 8503


Here is a example.
Attachment:
sample.zip [61.29 KiB]
Downloaded 717 times


Please import the sample.zip.
There are two projects inside.
Attachment:
1.png
1.png [ 7.29 KiB | Viewed 8503 times ]


In lib.c, we put all functions in a user defined section ".rom_code".
Attachment:
2.png
2.png [ 13.71 KiB | Viewed 8503 times ]


In sag file, assign .rom_code to 0x510000
Attachment:
3.png
3.png [ 7.52 KiB | Viewed 8503 times ]


The output of project "usercode":
Attachment:
4.png
4.png [ 5.62 KiB | Viewed 8502 times ]

 Forum: AndesCore   Topic: 请教有没有办法设定stack的size?

Posted: Fri Aug 01, 2014 5:26 pm 

Replies: 1
Views: 22269


Hi!
You can set start of stack in SAG script as following:
Detailed information is listed in Programming guide.

USER_SECTIONS .vector
SDRAM 0x00000000
{
EXEC 0x00000000
{
* (.vector)
* (+RO,+RW,+ZI)
* KEEP (.text.foo)
STACK = 0x00800000
}
}

 Forum: BSP (Board Support Package)   Topic: inline and optimization

 Post subject: inline and optimization
Posted: Mon Jul 14, 2014 5:24 pm 

Replies: 0
Views: 11291


https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Inline.html 5.33 An Inline Function is As Fast As a Macro By declaring a function inline, you can direct GCC to integrate that function's code into the code for its callers. This makes execution faster by eliminating the function-call overhead; in additio...

 Forum: BSP (Board Support Package)   Topic: specify *.ld file

 Post subject: specify *.ld file
Posted: Mon Jun 30, 2014 2:57 pm 

Replies: 0
Views: 7947


You can use -T to specify *.ld file.

Attachment:
pic1.png
pic1.png [ 56.61 KiB | Viewed 7943 times ]


Attachment:
pic.png
pic.png [ 72.72 KiB | Viewed 7943 times ]


nds32le-elf-gcc -Os -nostartfiles -static -T ../nds32.ld -Wl,-Map,link.map -mrelax crt0.o init-default.o init-soc.o interrupt.o main.o uart.o -o demo-int.elf

Sample code:
Attachment:
demo-int.zip [415.36 KiB]
Downloaded 804 times

 Forum: BSP (Board Support Package)   Topic: Software overlay sample code

Posted: Tue Jun 24, 2014 5:51 pm 

Replies: 0
Views: 7655


USER_SECTIONS .section0, .section1, .section2 ROM 0x0 { RAM 0x0 { *(+RO, +RW, +ZI) STACK = 0xA00000 } } ROM_OVLY 0x14000 { RAM2 0x4000 OVERLAY 0x0 { .overlay0 {* (.section0)} .overlay1 {* (.section1)} .overlay2 {* (.section2)} } } Example: sw-overlay1.png sw-overlay-sag.zip

 Forum: BSP (Board Support Package)   Topic: Hardware overlay sample code

Posted: Tue Jun 24, 2014 5:50 pm 

Replies: 0
Views: 7541


USER_SECTIONS .section0, .section1, .section2 ROM 0x0 { RAM 0x0 { *(+RO, +RW, +ZI) STACK = 0xA00000 } } ROM_OVLY 0x14000 { RAM2 0x4000 OVERLAY 0x2000 { .overlay0 {* (.section0)} .overlay1 {* (.section1)} .overlay2 {* (.section2)} } } Example: hw-overlay.png

 Forum: BSP (Board Support Package)   Topic: sag "KEEP" sample code

 Post subject: sag "KEEP" sample code
Posted: Tue Jun 24, 2014 4:44 pm 

Replies: 0
Views: 6811


KEEP is a keyword and must be upper-cased. It marks the sections that should not be eliminated when link-time garbage collection is in use. USER_SECTIONS .vector SDRAM 0x00000000 { EXEC 0x00000000 { * (.vector) * (+RO,+RW,+ZI) * KEEP (.text.foo) STACK = 0x00800000 } } keep_sample.zip

 Forum: BSP (Board Support Package)   Topic: sag sample

 Post subject: sag sample
Posted: Fri Jun 13, 2014 7:15 pm 

Replies: 0
Views: 6740


Code:
LOAD_ROM_1 0x0000
{
   EXEC_ROM_1 0x0000
   {
      ./src/program1.o SORT (+RO)    
   }
   DRAM 0x10000 0x8000 {
      ./src/program1.o (+RW, +ZI)
   }
}
LOAD_ROM_2 +0x1000
{
   EXEC_ROM_2 +0x1000
   {
      *(.text)
      *(+RO)
   }
      SRAM 0x18000 0x8000
      {
      * (+RW, +ZI)
      }
}

 Forum: AndeSight MCU/RDS   Topic: Refresh Policy

 Post subject: Refresh Policy
Posted: Fri Jun 13, 2014 5:43 pm 

Replies: 0
Views: 6636


If your project is always built with all *.c files, you may check two things.
(1) The Refresh Policy:
The Refresh Policy should be consistent with project name.
Attachment:
refresh_policy.png
refresh_policy.png [ 44.3 KiB | Viewed 6636 times ]


(2)Include path should be cygwin path or relative path.
DO NOT use the DOS-style path.
Attachment:
include.png
include.png [ 13.5 KiB | Viewed 6636 times ]
Sort by:  
Page 4 of 49 [ Search found 487 matches ]


All times are UTC + 8 hours [ DST ]


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