09-18-2017 02:45 AM
I have successfully build the Microblaze processor and managed to get the GPIO example in SDK to work to flash an LED.
I have also learnt to use updatemem in Vivado to update the bit file with the latest elf file (with implementing the design each time) with changes I made to see if the code was being updated and this works well.
I can change the LED that flashes and also the flashing speed from SDK, so I'm confident I've got the SDK - bitstream working well.
I now need to move to the next part of the project which is to interface an external device to the EPC (External Peripheral Controller) and use SDK to communicate with the EPC.
Does anyone know of an example that I could use to get started?
I have created the EPC in the Microblaze and the address range is visible in the SDK system.hdf view, but I don't know how to write to it in SDK.
Any help here would be much appreciated.
10-04-2017 08:18 AM
Well I figured it out.
Here's what to do for anyone who is interested:
When exporting hardware from Vivado to SDK, a system.hdf file is created and sent to the SDK.
Here the memory address ranges of your Microblaze peripherals is listed.
For mine, the EPC address range is:0x43E00000 - 0x43E0FFFF
So in SDK, I use:
to write to EPC memory space:
#define EPC_BASE_ADDR 0x43E00000
#define ADCDTPFID (EPC_BASE_ADDR + (ADCDTPFID_ADDR << 2))
to read from EPC memory space:
Read_data = Xil_In32(ADCDTPFID);
Base address is defined as starting address of EPC in Microblaze. Offset address is added to that address to read/write a specific location.
Easy when you know how!