pico-feedback icon indicating copy to clipboard operation
pico-feedback copied to clipboard

RP2350 pioasm .fifo putget configuration description

Open magy00 opened this issue 1 year ago • 5 comments

In the pioasm documentation of the pico-series C/C++ SDK, and of the RP2350 datasheet as well, it looks like the entry putget for directive .fifo <fifo_config> should be something like

putget: 4 FIFO entries for TX, and 4 FIFO entries in common for mov rxfifo[index], isr aka put and mov osr, rxfifo[index] aka get.

instead of

putget: 4 FIFO entries for mov rxfifo[index], isr aka put, and 4 FIFO entries for mov osr, rxfifo[index] aka get.

It would probably also be helpful if the association between the constants used for pioasm, SDK defines, and hardware register defines, could be clarified somewhere, since the three different sections don't include all the same details (note, for example, that TXGET [presumably from TX-FIFO+RX-GET] corresponds to RX_GET [presumably from RX-FIFO-used-for-GET]):

pioasm           SDK API                 hw register
txrx   <=>  0 == PIO_FIFO_JOIN_NONE  <=> -
tx     <=>  1 == PIO_FIFO_JOIN_TX    <=> FJOIN_TX
rx     <=>  2 == PIO_FIFO_JOIN_RX    <=> FJOIN_RX
txget  <=>  4 == PIO_FIFO_JOIN_TXGET <=> FJOIN_RX_GET
txput  <=>  8 == PIO_FIFO_JOIN_TXPUT <=> FJOIN_RX_PUT
putget <=> 12 == PIO_FIFO_JOIN_PUTGET == PIO_FIFO_JOIN_TXPUT|PIO_FIFO_JOIN_TXGET <=> FJOIN_RX_PUT|FJOIN_RX_GET

It would also be nice to have the pioasm directives section of the RP2040 datasheet updated to SDK 2.1.

magy00 avatar Jan 02 '25 14:01 magy00

Perhaps the apparent inconsistency between TXGET (in the SDK) and RX_GET (in the PIO hardware registers) is because the SDK is looking at things from the system-side, where it transmits data to the FIFO; whereas the PIO hardware registers are looking at things from the PIO-side, where it receives data from the FIFO?

lurch avatar Jan 02 '25 16:01 lurch

Possibly (but then maybe put and get need also to be exchanged?).

In the RP2350 datasheet, there is PINCTRL_JMP_PIN mentioned twice. This should probably be one of the other used EXECCTRL_JMP_PIN, JMP_PIN, JMPPIN or jmppin identifiers (like with the different but similar names above, a simple keyword search in the PDF datasheet cannot find all the relevant information, and they are not linked to each other [as in hypertext or in a glossary or so]). Also mentioned in #430.

magy00 avatar Jan 03 '25 03:01 magy00

In the RP2350 datasheet, there is PINCTRL_JMP_PIN mentioned twice.

Yeah, looks like there might have been a bit of a mix-up and this should probably have been EXECCTRL_JMP_PIN i.e. referring to the JMP_PIN field in the SM0_EXECCTRL, SM1_EXECCTRL, SM2_EXECCTRL & SM3_EXECCTRL registers.

lurch avatar Jan 03 '25 13:01 lurch

Maybe the frequency of all-caps words in the docs could help to detect such instances (but of course nowadays AI could probably be directed to do such).

magy00 avatar Jan 04 '25 12:01 magy00

Yeah, looks like there might have been a bit of a mix-up and this should probably have been EXECCTRL_JMP_PIN i.e. referring to the JMP_PIN field in the SM0_EXECCTRL, SM1_EXECCTRL, SM2_EXECCTRL & SM3_EXECCTRL registers.

Just to keep things nicely interlinked, see also https://github.com/raspberrypi/pico-sdk/issues/242

lurch avatar Mar 26 '25 08:03 lurch