Fully hosted application acting as SPI slave

5 posts / 0 new
Last post
BarryReinhold
Offline
Last seen:6 years 2 days ago
Joined:2014-07-22 21:15
Fully hosted application acting as SPI slave

I am seeking to build a system in which the DA14580 hosts an application that uses the BLE API and communicates to another application on an external MCU over SPI, where the external MCU is the SPI master.

In going down this path I have based my work on the proximity\reporter_fe_spi project. This module contained the code for the SPI slave, and the associated protocol outlined in UM-B-013. However it is setup for a fe environment whereas I am looking for a fh environment.

I created a fh project and included the spi_hci.c code. However, this causes a conflict as the SPI_Handler symbol is multiply defined. After digging through the code I am pretty sure I need this symbol is order to get the SPI interrupt. Hence I resolved the conflict by modifying the symdef file.

However, I am concerned that I am traveling down a wrong path here and would like to know:

1. What is the proper approach for having both an application (fh) on the DA14580 while also working with an external MCU as the SPI master?
2. Are there some other steps that I will need to take in order to get control over the SPI interface from the ROM code?

PY_Dialog
Offline
Last seen:2 years 8 months ago
Staff
Joined:2014-08-25 09:59
Hi BarryReinhold,

Hi BarryReinhold,

From your description, you need a full hosted applicaiton(application level code also in DA14580, beside BLE stack). So I would suggest you start from reporter_fh project. Then if you need SPI slave driver, you'd better port SPI slave code from reporter_fe_spi to reporter_fh.

Regards!
PY

BarryReinhold
Offline
Last seen:6 years 2 days ago
Joined:2014-07-22 21:15
Ok - That might be a bit too

Ok - That might be a bit too high level to be helpful, let me dig down a bit.
When using the fh approach as a base, the rom code still has interrupt controllers that I need to take control of as they hand it off to code (spi hci) that I don't want to use. For instance, to gain control of the CS line I have a handler for the symbol GPIO1_Handler defined in boot_vector.s. However, this handler causes a multiply defined symbol, which I resole by modifying the sysdefs file. This allows me to compile but the handler doesn't get called -- it appears to go to a different symbol $$Sub$$GPIO1_handler.

Also, is there a trick to getting the Keil debugger to print stack variables (that are clearly in scope). I have set the optimization level to -O0 but local variable are still out of scope and can't be used.

I am not familiar with this notation, and the symbol itself does not exist in the rest of the project. What is $$Sub$$ notation? Can I just take over this handler?

kobyfr_mag
Offline
Last seen:4 years 11 months ago
Joined:2015-06-02 12:48
Hello Barry.

Hello Barry.
I would like very much like to know if you managed finally to get the DA14580 to act an SPI slave.
I've just made it successfully transmit as an SPI master, but no luck reading anything !=0 as an SPI slave.
I've tried to find the demo projects "proximity\reporter*" but without luck.
Could you please paste a link to them?

Thank you

MT_dialog
Offline
Last seen:1 week 4 hours ago
Staff
Joined:2015-06-08 11:34
Hi kobyfr_mag

Hi kobyfr_mag

You can find the proximity reporter reference design in the SDK3.0.10.1 in the \DA14580_581_583_SDK_3.0.10\dk_apps\keil_projects\proximity\prox_reporter.

Thanks MT_dialog