Author |
Message |
Forum: Programming Topic: Assign static library to specific address |
cindy |
Posted: Sat Aug 02, 2014 10:57 pm
|
|
Replies: 1 Views: 8680
|
Another sample code
Attachment:
usercode2.zip [46.45 KiB]
Downloaded 815 times
Output message:
Attachment:
5.png [ 17.25 KiB | Viewed 8676 times ]
|
|
|
Forum: Programming Topic: Assign static library to specific address |
cindy |
Posted: Sat Aug 02, 2014 10:28 pm
|
|
Replies: 1 Views: 8680
|
Here is a example.
Attachment:
sample.zip [61.29 KiB]
Downloaded 770 times
Please import the sample.zip. There are two projects inside.
Attachment:
1.png [ 7.29 KiB | Viewed 8680 times ]
In lib.c, we put all functions in a user defined section ".rom_code".
Attachment:
2.png [ 13.71 KiB | Viewed 8680 times ]
In sag file, assign .rom_code to 0x510000
Attachment:
3.png [ 7.52 KiB | Viewed 8680 times ]
The output of project "usercode":
Attachment:
4.png [ 5.62 KiB | Viewed 8679 times ]
|
|
|
Forum: AndesCore Topic: 请教有没有办法设定stack的size? |
cindy |
Posted: Fri Aug 01, 2014 5:26 pm
|
|
Replies: 1 Views: 22758
|
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 |
cindy |
Posted: Mon Jul 14, 2014 5:24 pm
|
|
Replies: 0 Views: 11649
|
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 |
cindy |
Posted: Mon Jun 30, 2014 2:57 pm
|
|
Replies: 0 Views: 8171
|
You can use -T to specify *.ld file.
Attachment:
pic1.png [ 56.61 KiB | Viewed 8167 times ]
Attachment:
pic.png [ 72.72 KiB | Viewed 8167 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 860 times
|
|
|
Forum: BSP (Board Support Package) Topic: Software overlay sample code |
cindy |
Posted: Tue Jun 24, 2014 5:51 pm
|
|
Replies: 0 Views: 7845
|
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 |
cindy |
Posted: Tue Jun 24, 2014 5:50 pm
|
|
Replies: 0 Views: 7711
|
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 |
cindy |
Posted: Tue Jun 24, 2014 4:44 pm
|
|
Replies: 0 Views: 6971
|
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 |
cindy |
Posted: Fri Jun 13, 2014 7:15 pm
|
|
Replies: 0 Views: 6846
|
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 |
cindy |
Posted: Fri Jun 13, 2014 5:43 pm
|
|
Replies: 0 Views: 6771
|
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 [ 44.3 KiB | Viewed 6771 times ]
(2)Include path should be cygwin path or relative path. DO NOT use the DOS-style path.
Attachment:
include.png [ 13.5 KiB | Viewed 6771 times ]
|
|
|
Sort by: |