hydrabus / hydratool

HydraBus host tool with GUI (Qt)
31 stars 2 forks source link

Error "Frame size error resync data" using HydraFW v0.9 Beta #2

Closed rossHell closed 5 years ago

rossHell commented 5 years ago

The communication seems to be broken using the HydraFW version 0.9 beta.

2019-02-19 14_26_44-hydratool v0 3 1 0 - 16 june 2017 based on qt5 10 1

It is working when downgrading to the HydraFW version 0.8 beta.

Probably something has changed in the new firmware and not been updated in HydraTool code.

bvernoux commented 5 years ago

Thanks for the issue Could you provide more details on mode used to reproduce it ? (as there is multiple mode for the real-time sniffer) ?

Note: I have just updated the source code of HydraTool to v0.3.2 (to support parity enabled/disabled) could you test it ?

Thanks to provide more details on exact version of HydraFW tested which reproduce an issue

rossHell commented 5 years ago

Thank for quick reply. I have used the mode nfc sniff bin frame-time. I have followed this tutorial: https://github.com/hydrabus/hydrafw/wiki/HydraFW-HYDRANFC-guide#sniffer-iso14443a-with-unique-hard-real-time-infinite-trace-mode

NFC> sniff bin frame-time
sniff_14443A_bin start
Abort/Exit by pressing K4 button
TRF7970A chipset init start
Chip Status Register(0x00) read=0x21 (shall be 0x21)
ISO Control Register(0x01) read=0x24 (shall be 0x24 TypeA / 0x25 TypeB)
ISO 14443B Options Register(0x02) read=0x00
ISO 14443A Options Register(0x03) read=0x00
Modulator Control Register(0x09) read=0x11 (shall be 0x11)
RX SpecialSettings Register(0x0A) read=0x35
Regulator Control Register(0x0B) read=0x87 (shall be 0x87)
Test Settings Register(0x1A) read=0x40 (shall be 0x40)
TRF7970A chipset init end
Init SPI1 end
TRF7970A sniffer started
Init UART1 8.4Mbauds 8N1 OK
Connect FTDI C232HM-DDHSL-0 RXD(Yellow) to PA9(HydraBus UART1 TXD) for live sniffing session
Starting Sniffer ISO14443-A 106kbps ...

Version of the firmware is the v0.9 Beta, downloaded from here: https://github.com/hydrabus/hydrafw/releases

Here is show system result:

HydraFW (HydraBus) v0.9-beta-0-g17a50ac 2018-09-30
sysTime: 0x00023afe.
cyclecounter: 0x925f7482 cycles.
cyclecounter64: 0x00000000925f7494 cycles.
10ms delay: 1680025 cycles.

MCU Info
DBGMCU_IDCODE:0x100F6413
CPUID:        0x410FC241
Flash UID:    0x33001C 0x31374706 0x33373331
Flash Size:   1024KB

Kernel:       ChibiOS 4.0.4
Compiler:     GCC 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 227977]
Architecture: ARMv7E-M
Core Variant: Cortex-M4F
Port Info:    Advanced kernel mode
Platform:     STM32F4x5 High Performance with DSP and FPU
Board:        HydraBus 1.0
Build time:   Sep 30 2018 - 14:33:13

I did try with version 0.3.2.0 of HydraTool, unfortunately the issue remains. I will upload fw v0.8 again for testing

bvernoux commented 5 years ago

Thanks for the details

1) Could you do a capture with hydratool -> SaveDirectToDisk and provide the file when the issue appears on FW v0.9 ? If possible please do the same with FW v0.8 where all shall work fine Thanks to provide the files for check

2) Could you check the sniffer with ASCII mode and capture it (on both FW v0.8 & v0.9 woth same test) to check if it works fine ? Thanks to provide the files for check

Note: Thanks to confirm if you use C32HM-DDHSL-0 or an other variant I hope you have good connection / wire and short wire (less than 15cm if possible) for the connection between C32HM-DDHSL-0 & HydraBus as it is quite sensitive at 8.4Mbit/s

rossHell commented 5 years ago

Here it is: debug_captures.zip

You will find inside:

[debug_captures]
  [fw_v0.9]
      - fw_v0.9_bin_capture.bin
      - fw_v0.9_ascii_capture.txt
  [fw_v0.8]
      - fw_v0.8_bin_capture.bin
      - fw_v0.8_ascii_capture.txt

Hope this will help.

Also I confirm I'm using the FTDI C232HM-DDHSL-0 cable. Wires are connected directly on the board withtout any cable between. 20190222_162610

edit: The sequences I have recorded are not the same of course. I was just playing by putting a tag in the field of a ISO14443 reader. So it is mostly polling from the reader.

bvernoux commented 5 years ago

Thanks for all details After checking the fw_v0.9_bin_capture.bin I confirm there is definitely something wrong I suspect the UART speed is wrong ... as the fw_v0.9_ascii_capture.txt seems to work fine I will do some tests and fix that as soon as possible but it will take few weeks as I'm very busy with tons of things

rossHell commented 5 years ago

There is not any urgency about this, actually I can live with the fw v0.8. Thanks for the investigation. Let me know if I can help for the fix. Regards

bvernoux commented 5 years ago

I have done some fix especially one which should fix this issue (added missing explicit initialisation of bus_mode added in latest refactor => mode_conf.config.uart.bus_mode = BSP_UART_MODE_UART) https://github.com/hydrabus/hydrafw/commit/5204114befa889c6358f8d19350ae0c9862c7d64 Could you rebuild the firmware with HydraFW master and tell me if that fix the issue

Note: This issue shall be part of HydraFW issue (even if I have fixed minor things at same time in this tool) I have created it here https://github.com/hydrabus/hydrafw/issues/93

rossHell commented 5 years ago

Sorry for my late reply. Actually I don't have the tools installed for building the HydraFW and to be honest I prefer to avoid installing them.

bvernoux commented 5 years ago

I confirm this issue is fixed with latest hydrafw master 55e5dbe See archive build_HydraFW_v0.9-beta-65-g55e5dbe_HydraBus_HydraNFC.zip of the firmware pre-built See https://github.com/hydrabus/hydrafw/issues/93