Forum Discussion
Altera_Forum
Honored Contributor
8 years ago --- Quote Start --- Yes. My system works right now. I have abandoned the mSGDMA module. I put a Write Master and a Dispatcher Control as I only need to write onto the SDRAM. Are you struggling with it? Let me know if I can help you with something. --- Quote End --- Hello Marcio, Yes, there is quite some struggle here... :) At the moment I fell back on an example of CriticalLink ( https://support.criticallink.com/redmine/projects/mityarm-5cs/wiki/writing_to_hps_memory ) (Although I am using the DE0-Nano-SoC, but that shouldn't be an issue.(?)) I Also found a note by CL saying some steps have to be made in order to use the sdram-bridge (https://support.criticallink.com/redmine/projects/mityarm-5cs/wiki/important_note_about_fpgahps_sdram_bridge). I made a small script in linux that takes care of this after boot:
# !/bin/bash
# https://support.criticallink.com/redmine/projects/mityarm-5cs/wiki/Important_Note_about_FPGAHPS_SDRAM_Bridge
# start by disabling all fpga-hps bridges
echo =
cat /sys/class/fpga-bridge/*/enable
echo 0 > /sys/class/fpga-bridge/fpga2hps/enable
echo 0 > /sys/class/fpga-bridge/hps2fpga/enable
echo 0 > /sys/class/fpga-bridge/lwhps2fpga/enable
echo =
cat /sys/class/fpga-bridge/*/enable
echo =
memtool -32 0xFFC25080=0x0
echo =
cat /sys/class/fpga/fpga0/status
dd if=P10.rbf of=/dev/fpga0 bs=1M
cat /sys/class/fpga/fpga0/status
# at this point, if fpga status is not user mode - program the fpga manually with the programmer
read -p "Should I continue? y/n: " -n 1 -r
echo
if $ ]]
then
cat /sys/class/fpga/fpga0/status
sleep 1
echo =
memtool -32 0xFFC2505C=0x8
echo =
memtool -32 0xFFC25080=0x111
echo
echo 1 > /sys/class/fpga-bridge/fpga2hps/enable
echo 1 > /sys/class/fpga-bridge/hps2fpga/enable
echo 1 > /sys/class/fpga-bridge/lwhps2fpga/enable
cat /sys/class/fpga-bridge/*/enable
echo
memtool -32 0xFFC25080 1
fi
If I'm not mistaken, these steps should take care of everything mentioned by CL. with the only difference being it is done after boot instead of in the preloader ( because I am not yet familiar with making preloaders) If I start my program after this, the hps will freeze the moment it reaches the descriptor part. Does any of this ring a bell? :) Kind regards, Robin