Trenz Electronic GmbH Support Forum

Community => SMF2000 community projects => Topic started by: enliteneer on March 22, 2020, 04:48:12 PM

Title: Interfacing Arm to custom Logic
Post by: enliteneer on March 22, 2020, 04:48:12 PM
Microsemi has a 2012 app note (AC335) how to do it, but I haven't been able to make it work.   

Basically, just creating a simple project that uses their example AP3 wrapper/slave around a reg16x8 ram block.   Everything seems to synthesize/route fine, yet once programmed, the moment I step the cpu thru a line that accesses the logic/memory, I get a hard fault.

I had to modify their reg_apb_wrp.v file in order to make it work with Libero 12.3, but not sure if this is the issue.    Also, not sure why the tool put the slave at both 0x50000000-0x50000FFF AND 0x30000000-0x30000FFF nor why it's 0x1000 in length.    I'd like to add much more custom logic, and since there's only 2 FIC, I need a much bigger memory map to decode outside of the arm!

(https://imgur.com/5wnin8O)
(https://imgur.com/5wnin8O)
(https://imgur.com/y41V3An)
(https://imgur.com/A86lj1q)
(https://imgur.com/mu8nNtm)
(https://imgur.com/pxCJEA1)
Title: Re: Interfacing Arm to custom Logic
Post by: Antti Lukats on March 23, 2020, 08:20:26 AM
did you try reading writing the apb peripheral from the debugger? It does different access then

we have done little work with smartfusion, but with one project we had no issues, there I used a dual port block ram interface to the hard cpu and to the fpga fabric
Title: Re: Interfacing Arm to custom Logic
Post by: enliteneer on March 23, 2020, 04:53:42 PM
Thanks, would the design you mention be the one listed under the SMF2000 resources (SMFSDRAM.zip)?   I couldn't find any custom hdl/firmware files in that zip.   

Using the Memory tab in Eclipse, I don't get a hard fault when reading/writing the apb3 slave memory space!   Interestingly, it seems as if it's a byte access issue.   For example, this will crash:

uint8_t rdVal;
uint8_t *pUserLogic8 = (uint8_t*) (0x50000000);
rdVal = *(pUserLogic8 +3 ); 

but this wont:
uint8_t rdVal;
uint8_t *pUserLogic8 = (uint8_t*) (0x50000000);
rdVal = *(pUserLogic8 +4 ); 

Do you see anything obvious with the screenshots of the project settings?
Title: Re: Interfacing Arm to custom Logic
Post by: fab79df on November 06, 2020, 10:00:13 AM
Replying here instead of starting a new one because I have a very similar issue using a Smartberry board. By chanche, was this isssue on the same board? In any case, can you confirm the latest post describes a tested solution? Thanks all