-
-
Notifications
You must be signed in to change notification settings - Fork 5
Ipc driver 2: Electribe boogaloo #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| /*----- Typedefs -----------------------------------------------------*/ | ||
|
|
||
| typedef enum { STATE_INIT, STATE_RUN, STATE_ERROR } t_cpu_task_state; | ||
| typedef enum { STATE_INIT, STATE_RUN, STATE_HANDSHAKE, STATE_ERROR } t_cpu_task_state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i accidentally left this in
|
hi ! can you provide an example of using this feature from the application layer ? |
https://github.com/vananasun/freetribe.git test-ipc-sys23 it has a nice little sequencer demo, in cpu system23.c You have this code: that's essentaially all there is to it. DSP gets the same functions. Think of it as memcpy across CPU<->DSP |
It should take some load off the CPU. The EDMA has a lot of features for multidimensional transfers, we should be able to transfer arbitrary length arrays of 4 byte words in 16 word chunks with a single DMA event.
As far as I can tell, the factory firmware doesn't use DMA at all on the CPU. Some drivers are interrupt driven, others use polling with a timeout. If the debug printing commit works as a standalone feature, it might be better as a separate pull request. I still don't have any of my gear set up, so I can't actually test anything for a while. |
After studying EDMA3 and embedded topics a lot I definitely agree that EDMA3 transfers should be integrated into the EMIFA driver. It would be useful to sketch out together somewhere what the EDMA3 driver implementation should and shouldn't be able to do. To sum up use cases:
Does this mean they didn't squeeze all the juice out of the KORG's processing power? Good news!!
Just comment it out while testing, it's merely printf built on top of ft_print. However,
By the way I got a J-Link clone coming and an RPI setup, but I didn't wanna destroy my electribe by soldering the header. I tried taping the fucking thing like a noob but then I short circuited my electribe so do u know some non-permanent or destructive way to attach the JTAG header? |
Whether it's a clever design for reduced power and deterministic timing, or they just didn't get that far is impossible to tell. I say we add support for everything the hardware can do, then profile performance to choose which parts we want in what situations.
Your best option is to solder the header, or get someone to do it for you, any competent laptop repair technician could do this. I had to increase the temperature quite a lot when soldering the ground pin, as the PCB ground plane absorbs all the heat. I couldn't find any hook probes small enough to get all pins attached next to each other. Also, any temporary connection will move and gradually wear through the plating on the PCB. A poor electrical connection will make the software impossible to debug. |
There's still some work to be done, but this'll do for now.
Data can be transmitted, and there's also a function to request data from the other side.
HostDMA runs in stop+interrupt mode. Everything fires in bursts except for the last block of data.
Do you think using EDMA3 in the EMIFA driver would actually increase performance? Each transfer can never be more than 16 words. Since factory firmware has burst mode turnt off, that could be an indication that KORG's driver does something special, like using EDMA3 CPU side. It could prove useful to peek Ghidra for looped writes/reads to the MMR at SOC_EMIFA_CS2_ADDR; which is mapped to the HostDMA FIFO.
As for CPU-side performance improvements, it's still possible to unroll the data read loops, but it'd be marginal benefit
Transmission headers are stored 0x00000000 between 0x0000003F on the DSP external RAM, this is currently just some fixed magic number, and perhaps it should even be moved into cache.
There are some edge cases/error handlings to be finished. In particular, it'd be good to be able to actually error HostDMA to see if the recovery mechanism works properly, currently I tried by simulating DMA errors in the HostDMA ISR, but that is not entirely the same as a real error.
DSP->CPU data read requests have to be properly tested still, by now I expect them to work, but then again, I think it's about time we first add a printing bridge from DSP->CPU to allow for print debugging. I agree SPI would be the best option.
Test with -DDEBUG. The DSP makefile has a new thing called -DBLACKFIN that's to distinguish platform