electro-smith / libDaisy

Hardware Library for the Daisy Audio Platform
https://www.electro-smith.com/daisy
MIT License
331 stars 140 forks source link

MAX11300 does not seem to understand transaction complete on the 1st device when using a non-default GPIO for select #598

Open Electro-Jam opened 9 months ago

Electro-Jam commented 9 months ago

MAX11300 transmitting only once and it looks like the driver may not be understanding that the transaction completed.

In a new hardware build I moved my SPI chip select to a different GPIO pin. In looking at the initial transaction (see attached image) the first set of data looks correct. After that the driver is retuning an error. To me, it looks like the SPI DMA transfer does not understand that the transaction completed.

My pin setup: 1) I am using the Daisy DFM device 2) Here is the pin setup for all the ports:

MOSI: C4 / PA7 MISO: C2 / PA6 SCK: C9 / PA5 Select: C1 / GPI16 / PA3 3) Here is my code setup:

    max11300_config.Defaults();
    max11300_config.transport_config.pin_config.miso.port = DSY_GPIOA;
    max11300_config.transport_config.pin_config.miso.pin  = 6;
    max11300_config.transport_config.pin_config.mosi.port = DSY_GPIOA;
    max11300_config.transport_config.pin_config.mosi.pin  = 7;
    max11300_config.transport_config.pin_config.sclk.port = DSY_GPIOA;
    max11300_config.transport_config.pin_config.sclk.pin  = 5;
    max11300_config.transport_config.pin_config.nss->port = DSY_GPIOA;
    max11300_config.transport_config.pin_config.nss->pin  = 3;
    max11300_config.transport_config.baud_prescaler = daisy::SpiHandle::Config::BaudPrescaler::PS_2;
    volatile MAX11300Types::Result ret;

I'll continue to dig further into the code, but it seems as though the DMA controller may not be understanding that the completion happened.

Here is the image of the first and only transaction: image

Note: I have also posted this on Discord: https://discord.com/channels/1037767234803740694/1039306406190403594/1182702470640713759