Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,380 Views

how can i know whether the CFM is big enough for my nios project in max10 ?

hi, i use max 10 internal configuration. the device is 10M08, it  

i use nios + sdram, so i should download the both the hardware and software configuration files into the on chip flash. 

so, how can i know how many space does my projects need? 

i have done a test ,the software shows: 

Info: (test2.elf) 19 KBytes program size (code + initialized data). 

Info: 8172 KBytes free for stack + heap. 

i use the sof and hex file to generate a pof file, it works when i download the pof to the fpga. 

but i still want to know the limit of program size in eclipse. 

this is the output_file.map 

BLOCK START ADDRESS END ADDRESS 

ICB 0x00000000 0x000007FF 

UFM 0x00000800 0x000087FF 

CFM0 0x00008800 0x0004E7FF (0x0003F68F) 

 

Max 10 Setting: 

EPOF: OFF 

Verify protect: OFF 

Watchdog value: Not activated 

POR: Instant ON 

IO Pullup: ON 

SPI IO Pullup: ON 

 

Notes: 

- Data checksum for this conversion is 0x01802768 

- All the addresses in this file are byte addresses
0 Kudos
5 Replies
Altera_Forum
Honored Contributor I
82 Views

The hardware configuration size is constant for any given FPGA (unless compression is used). It is 0x3f68f in your case. You can use all available RAM for software and data. Eclipse doesn't know or care how large your object code is. If you have the memory and section sizes set correctly in the linker script, any built that doesn't fail will fit in memory. At runtime, check return codes for malloc etc to monitor the heap. See the sofware guide for info on detecting stack overflow.

Altera_Forum
Honored Contributor I
82 Views

thanks! 

in the max10 fpga device datasheet.pdf, i find the uncomperssed raw binary file is 1880000 bits, that is 0x395f8 bytes,  

19 KBytes program size (code + initialized data)=19*1024=0x4c00 

0x4c00 + 0x395f8=0x3 E1F8  

should this be smaller than CFM0(2240kb,280KB)? 

 

what is the 0x0003F68F? 

what is the ICB?
Altera_Forum
Honored Contributor I
82 Views

I don't remember what ICB stands for, but it essentially the interrupt and exception vectors for the NIOS processor. The configuration memory has some headers etc that account for the difference between 0x395f8 and 0x3F68F. You really don't need to worry about the static size of your program. If it builds without error it will fit. Heap and stack use depend on what you do in your code at runtime.

Altera_Forum
Honored Contributor I
82 Views

in one of my project, when i finish building the eclipse projec, it shows: 

Info: (test1.elf) 70 KBytes program size (code + initialized data). 

Info: 8121 KBytes free for stack + heap. 

 

there are no errors 

 

but when i make targets in eclipse, the following error shows: 

2016-1-12 16:04:47 - (警告) elf2flash: ELF file will not fit in flash. No flash file created 

 

so the project may be not fit even if eclipse builds without error, 

i just want to know the max size of the test1.elf program size  

 

BTW: 

is there any altera files discuss this problem? 

thanks! 

 

 

--- Quote Start ---  

I don't remember what ICB stands for, but it essentially the interrupt and exception vectors for the NIOS processor. The configuration memory has some headers etc that account for the difference between 0x395f8 and 0x3F68F. You really don't need to worry about the static size of your program. If it builds without error it will fit. Heap and stack use depend on what you do in your code at runtime. 

--- Quote End ---  

Altera_Forum
Honored Contributor I
82 Views

i think i am very close to the answer 

in https://www.altera.com/en_us/pdfs/literature/an/an730.pdf nios II processor booting methods in max 10 fpga devices 

the pdf tells mr that the nios II software.hex is storaged in the UFM(user on chip flash memory)! not in the CFM(configuration on chip flash memory)! 

in page 7, "executable code and boot copier must not exceed the size of the ufm", 

so the new questions: 

1. what is the size of boot copier? i find boot_loader.S is 9KB, the boot_loader_cfi_bits.S is 5 KB ,boot_loader_epcq256_bits_cv.S is 25KB 

2. does it means that if i use nios then i can not use UFM to storage some user data? 

3. the max UFM is 1376Kb in 10M08, if my nios project's executable code and boot copier only use 1000Kb, can i use the left 376Kb? 

4. is there any files can tell me the size of the executable code and boot copier and their address in UFM?
Reply