Altera_Forum
Honored Contributor
20 years agoDisable HAL to reduce memory footprint?
Hello NIOS friends,
I am working on a system that requires the time-critical DMA transfer of massive amounts of data between SDRAM and a custom peripheral. I don't want the instruction or data master of the the NIOS to access the SDRAM bus during these transfers. An idea I got from this forum a while ago is to change the bus arbitration priority in the SOPC builder, so I will have a guaranteed amount of bus cycles against each NIOS cycle. This worked well when the peripheral was reading from SDRAM, but if I do the same thing for writing to SDRAM (with a second DMA controller) the NIOS hangs... Another idea was to let the NIOS spin around in a small subroutine in an on-chip SRAM until the DMA transfer is done and than gain control over the SDRAM bus again. To achieve that, I defined a small (2Kbyte) on-chip RAM and I wanted to store a small (maybe even written in assembly) polling loop in that area. I hoped the linker would be smart enough to handle the definition: void useless_routine(void) __attribute__ ((section (“.cache”))); where "cache" is the on-chip RAM block. But it keeps generating error messages that I am using overlapping memory sections. OK, then I just made a new project in the IDE, defined all the pointers to point at the on-chip RAM, but the HAL simply makes the footprint to big; even with everything switched off (small footprint, no exit-check etc...) So: is there a way to park my small subroutine in on-chip RAM using my main program (which is copied from EPCS4 to SDRAM at power up) by somehow telling the linker to do so? Or is it wise to start writing a HAL independend program in assembly? Truely sorry about the long story. But if you've made it so far, you might be interested enough to come up with a bright idea. Thanks a lot.