Where to run MCU FW and NIOS-II SW from?

Hi,

After reading lot of good material on LimeSDR and FW/SW areas, I am little confused about following. Would be a great help if someone could please clarify:

  1. MCU source files are provided. But how to make a binary and where will it be running? Is it the one that can be written to MCU via Control command from Host, e.g. usingCMD_LMS_MCU_FW_WR?

  2. NIOS-II has C source files as well. Will the compiled form of this be combined with FPGA bitstream to make .rbf and then loaded to FPGA OR do we need to load NIOS-II separately somehow?

Thanks for your time.

Regards

Hi,

  1. MCU source code can be compiled using Keil C51 compiler/uVision IDE. The program would be executed on the LMS7002 integrated internal micro controller. CMD_LMS_MCU_FW_WR command usage is no longer needed, MCU binary image can be programmed manually using SPI writes/reads (MCU programming using SPI source). The compiler outputs program in Intel HEX format, which needs to be converted into binary form before being programmed into MCU.

  2. My knowledge of this is outdated, but it used to be that NIOS-II source would be compiled and combined with FPGA bitstream to produce .rbf.

1 Like

Thanks a lot for your reply.

Does it mean that anything related to LMS7002M configuration will not go through FW or NIOS-II anymore? Only data is read from LMS7002M through GPIF-II in that case?

In either case, do we need any other command/implementation to interact with LMS7002M chip before starting data transfer?

Regards

I’m not familiar with all the hardware internals, so can’t really comment on that. But obviously FW and NIOS-II are needed to perform the SPI communications between PC and the chip.

HI gchat,
From the material provided by factory.all calibarion,tuning and control can be written in NIOS-II with c/C++ code… then the Nois-II programm can be compiled with FPGA code to generate the combined programming file, then programming the FPGA , FPGA can configure the LMS7002 with SPI interface, of course, you should create SPI interface to LMS7002 in FPGA.
Regards!

HI ricardas,
Do you know how to directly program the MCU independent of FPGA? There are not any USB controllers on my board.
but I want to programm the MCU directly from my PC. Can I use the USB to SPI programmer? From the documents , I still don’t find any description for this topic. how about your opinion?

Thanks!

Hi @huangdeyong123

Not possible, while NIOS MCU FW is integrated to the same bitstream (or gateware) as FPGA configuration.

Just to clarify, if you are talking about the LMS7002M chip’s internal MCU, then yes, if you have a way to write/read SPI registers, you can program it using them in Internal MCU programming sequence.

If you are talking about NIOS MCU, then no, it is a part of FPGA bitstream.

thanks ricardas & Zack.
In theory, if there are not any USB controllers on my board. I can use the USB to SPI converter outside of my board to program the MCU directly, but there are not any documents provided by factory to stress this topic. I want help to verify whether this way is OK or not.

Regards!

Hello ricardas,
Could you pls talk about the difference of function between the source code running in NOIS II core of FPGA and that of MCU in LMS7200M? There are two MCUs on the board, on is located in LMS7002M, another is located in FPGA, why not use two MCUs, not just one? if I only use FPGA, including its NOISII core to calibrate, tune,control LMS7002M, is it OK? if OK, do I need to add/change the C code for NiosII? Thanks !

There should be no differences if the code would be running on NIOSII. The only difference is that LMS7002M MCU is a 8 bit, while NIOSII is a 32bit architecture which would use more resources.
The reason why two MCUs were used is to save FPGA resources and that LMS7002 MCU can be reprogrammed at runtime.
It’s perfectly OK to do everything from FPGA NIOSII but you would have to add all the calibrations source code to NIOSII project and modify appropriate functions for writing SPI registers.

Thanks ricardas for you kind help!
Are there any C reference designs for all work(including calibration, tuning, control,etc.) are put into NOISII ?
Meanwhile, Because there are not any USB controllers on my board. Could I use Limesuite debug tool through the usb to spi converter to debug my board?
Thanks again!