DeviationTX / deviation

Custom firmware for RC Transmitters
http://www.deviationtx.com
GNU General Public License v3.0
249 stars 155 forks source link

"HAS_4IN1_FLASH" build option breaks DSM/DSMX protocol. #925

Open vladislavy opened 4 years ago

vladislavy commented 4 years ago

It's impossible to bind with DSM/DSMX protocol. With disabled "HAS_4IN1_FLASH" all work fine.

joeclone commented 4 years ago

Has there been any updates concerning this issue? Is such a waste that the latest features and protocols are not brought into https://www.deviationtx.com/forum/builds/8508-reference-nightly-build-deviation-v5-x-x#75174

vladislavy commented 4 years ago

I can't find any reason why DSM/DSMX protocol failed with "HAS_4IN1_FLASH" enabled. Probably it's timing issue related to void PROTO_CS_HI(int module) and void PROTO_CS_LO(int module) at "protocol.c".

TheRealMoeder commented 4 years ago

I also looked into it but cannot find the issue yet. Maybe @goebish has some idea?

joeclone commented 4 years ago

Thanks a lot for taking the time to look into this problem. In the mean time is there possibility of having a build that has working dsm/dsmx and the pxx protocols intact?

vladislavy commented 4 years ago

Most likely it's timing issue. With "HAS_4IN1_FLASH" enabled, but "HAS_MULTIMOD_SUPPORT" disabled, DSM/DSMX protocol also work fine. I suspect multi register CYRF setup is too slow. Any additional check at PROTO_CS_HI and PROTO_CS_LO can slow down multi register setup. Problematic nrf24l01 protocol (I don't remember exactly) also can have the same problem.

vladislavy commented 4 years ago

Can it be related to: Fix inconsistency in SPI baud-rate setting resulting in wrong spi speed #787 ???

goebish commented 4 years ago

I don't think that's related, #787 fixes wrong SPI clock rate that was set during the refactoring.

vladislavy commented 4 years ago

Why we use SPI2 clock 36/16=2.25MHz? DIY-Multiprotocol module use clock 36/8=4.5MHz

goebish commented 4 years ago

that's not normal, we should use 4.5MHz as well.

vladislavy commented 4 years ago

joeclone tested build with "HAS_4IN1_FLASH" and "HAS_MULTIMOD_SUPPORT" enabled and SPI2 clock 36/8=4.5MHz, but it doesn't help, he can't bind.

I can't test it, my devo8 can bind to Spektrum Rx at any case.

joeclone commented 4 years ago

Meaning this problem is specific to devo10?

vladislavy commented 4 years ago

With SPI2 clock 36/8=4.5MHz Hubsan (A7105) has dropouts, but it can be fixed the same way as in DIY-Multiprotocol, disable-enable interrupts inside PROTOSPI_read3wire(). Devo protocol (CYRF6936) work fine, about a hour of testing. I can't test CC2500 and nRF24L01.