Forum Discussion
Altera_Forum
Honored Contributor
21 years agoGreat to hear everything is working now. So now you play with scripting. E.g. --
automatically attempt an NFS download and execute the download on success, otherwise jump into flash ;-) Some notes: > I had originally set CFG_NIOS_TMRMS to 1 thinking I had to match the default hw. The timer stuff can be confusing. The two most important macros are: cfg_nios_tmrms -- number of milliseconds between each timer interrupt. cfg_hz -- the frequency of the timer interrupt. The two are of course redundant, but they're both defined to encourage using the preprocessor for divide/multiply where possible. Sine the Nios timer may be configured with/without the period registers, another macro, cfg_nios_tmrcnt is used. If this macro is defined, the value is written into the timer's period registers when u-boot starts, but is otherwise never referenced. If the macro is not defined, the period registers are never accessed, period. The intent of CFG_NIOS_TMRCNT is to allow users to slow down the interrupt rate when the period is programmable. A 1 ms rate is (normally) overkill in a boot monitor. Since I have a tendency to misplace the decimal point, I use the sleep command to do a sanity check. Try for example, "sleep 10" while looking at your watch ;-) BTW: the timer macros are (indirectly) used by most of the network protocol modules, and by the flash programming code. >I guess it does not matter that I have no cache. Correct, the cache instructions behave as NOP when no cache is configured -- so the bogus instructions do little more than add an unnecessary delay loop when they're left in the code. After downloading, u-boot invalidates the region that was loaded (both data and instruction caches) to ensure everything is coherent.