lnDSO150 icon indicating copy to clipboard operation
lnDSO150 copied to clipboard

Hangs on first calibration screen --processing--

Open ShaviTF opened this issue 3 years ago • 58 comments

The whole procedure has apparently gone well, but when I start the device for the first time, it asks me to place the probe to ground, then to put it in DC mode and when I click ok it indicates --processing-- and it hangs... Any suggestion?

2022-10-11 12 02 2022-10-11 12 03 (1) 2022-10-11 12 03

ShaviTF avatar Oct 11 '22 11:10 ShaviTF

Hi You have done the hard part That problem is usually the sign of a problem when saving stuff to the flash 1- What is the complete reference of the MCU ? Would it be a CH32F103 by any chance ? 2- Which binary did you use / how did you build it if you built it from source ?

mean00 avatar Oct 11 '22 16:10 mean00

Hello... first of all, thank you for the work you are doing and for taking the trouble to help us...

1.  About the MCU is the STM32F103C8T6. I have been researching and I have seen that this one comes with 64 and with 128K. I am using STM's "Flash loader Demonstrator" to program it, and when I plug it in it saids me that it's the 128k version . 

2. I have tried the FNIRSI binary (without bootloader) flashing to 64k (in this case it boots but the ok button doesn't work) and the JYTECH binary (with bootloader) flashing to 128k... (The application doesn't give me any errors and after writing it verifies correctly, which makes me assume that it's really the MCU is 128k), but in this case it is where the calibration hangs.
 
I have not tried to compile the software myself, basically because I have never done it, but I will try to investigate how to do it

ShaviTF avatar Oct 11 '22 23:10 ShaviTF

1- Ok, assuming it's a guenuine STMF103CxT6 it should have 128 kB (but claiming it has only 64 kB) The "Flash loader Demonstrator" is using serial or swd ? There was report that if it using serial, you should make sure the watchdog is disabled and try to flash it twice, it may help (dont ask why)

2- Ok that behaviour shows it is not a CH32 style motherboard

If you can, try flashing the code using a stlinkv2 + openOCD or something similar, it should work

mean00 avatar Oct 12 '22 04:10 mean00

I am using UART, I don't have SWD programmer. I have tried programming several times and there is no difference. I've also tried disabling WatchDog (WDG_SW) with the "Flash Loader Demonstrator", but doing so only gives me a blank screen at boot. It's weird... I can get into DFU, and everything seems ok until it gets to calibration... then it hangs with the message "-processing-"

ShaviTF avatar Oct 13 '22 00:10 ShaviTF

Could you try the attached binary ? It skips calibration check, so you'll have garbage on screen but to check everything else works [](url lnDSO_nocal.zip

mean00 avatar Oct 13 '22 04:10 mean00

If it fails at the first calibration step (i.e. AC or DC) and not a the end, it's not the flash but rather the ADC If the test binary works for you, you can try manually doing a calibration Long press the rotary encoder to enter menu then Calibration -> wipe calibration reboot Calibration -> Basic calibrate

mean00 avatar Oct 13 '22 05:10 mean00

Ok... now finaly i could got into the application, but, although it does record data, the graph is not shown, that is, I can enter the menus and if I change the "Test signal" menu values (amplitude and frequency), these are reflected in the values detected by de probe in the left column, but the graph is not displayed on the main screen.

About calibration still not working. That is, I can do the "wipe calibration", but after reboot, when I hit basic calibration, it hangs at the same point as before (although now it doesn't show the sentence -processing-) 1 2 3 4

ShaviTF avatar Oct 13 '22 12:10 ShaviTF

Ok so in "normal" mode the ADC is working The display is gibberish because without calibration the values are out of scale Can you get the serial output when you do calibration ? (115200 / 8 bits/ no hw flow control / no parity)

mean00 avatar Oct 13 '22 12:10 mean00

Ok...

The only read i get is: Adc : Asked for fq=1000 got fq=1000 intDiv:1 int Frac=6464

And then it hangs immediately

ShaviTF avatar Oct 13 '22 14:10 ShaviTF

If you are willing to help me, i can try to find out what's going wrong by providing test firmwares, will probably take a few steps

mean00 avatar Oct 13 '22 14:10 mean00

No problem. For sure i will help you... in the real you are helping me :D

ShaviTF avatar Oct 13 '22 14:10 ShaviTF

Does this work ?, it will go to calibration at start (Trying to pindown the issue) nocal_mark2.zip

mean00 avatar Oct 13 '22 17:10 mean00

Now as you say goes to calibration at start, but hangs at "-processing-" again.

Terminal output is similar: Adc : Asked for fq=1000 got fq=1000 intDiv:1 intFrac=6464 Setting new GainRange=0

ShaviTF avatar Oct 13 '22 22:10 ShaviTF

Next : This is the expected output Setting new GainRange=0 Starting ADC... Ending ADC... Range : 0 val=2062

My guess is you will only have Starting ADC... cal3.zip

mean00 avatar Oct 14 '22 05:10 mean00

New output: Adc : Asked for fq=1000 got fq=1000 intDiv:1 intFrac=6464 Setting new GainRange=0 Starting ADC...

keeps hanging on -processing-

ShaviTF avatar Oct 14 '22 09:10 ShaviTF

Another one to test, i'm not expecting it to work but i fixed a bug, mayb....

A couple of questions :

  • When you switch the AC/DC button, does the display reflect the change (AC->DC->GND) ? If so it means ADC2 is working
  • The quartz should be a 8 Mhz one, could you confirm ?

nocal4.zip

mean00 avatar Oct 16 '22 06:10 mean00

Ok...sorry for the late response...I was out all day... It seems that now there is more information. I enclose the complete trace since the equipment starts.

  • Regarding whether the changes made to the AC/DC switch are reflected, yes, they are reflected. Before the calibration, it tells me in which position it is requiring me to position it in DC in order to proceed with the calibration.

  • I can also confirm that quartz is 8 Mhz

Hope this can help you

Setuping up DSO... 0: R=18 overSampling=0 1: R=36 overSampling=0 2: R=90 overSampling=0 3: R=180 overSampling=0 4: R=360 overSampling=0 5: R=900 overSampling=0 6: R=1800 overSampling=0 7: R=3600 overSampling=0 8: R=9000 overSampling=0 9: R=18000 overSampling=0 10: R=36000 overSampling=0 11: R=90000 overSampling=0 Starting sanity Check Check ok read Offset =0x4 Starting DSO... Setting new GainRange=7 Adc : Asked for fq=20000 got fq=20000 intDiv:0 intFrac=3600 New timebase=6 : 1ms, fq=20000 Cannot read invert setting Loading calibration data Cannot load AC calibration Adc : Asked for fq=1000 got fq=1000 intDiv:1 intFrac=6464 Setting new GainRange=0 Starting ADC... Ending ADC... Range : 0 val=2077 Setting new GainRange=1 Starting ADC...

after that, it keeps hanging on "-processing-" cuarzo

ShaviTF avatar Oct 16 '22 23:10 ShaviTF

That one may work nocal5.zip

mean00 avatar Oct 17 '22 06:10 mean00

I think we've taken a step backwards... The new output:

Setuping up DSO... 0: R=18 overSampling=0 1: R=36 overSampling=0 2: R=90 overSampling=0 3: R=180 overSampling=0 4: R=360 overSampling=0 5: R=900 overSampling=0 6: R=1800 overSampling=0 7: R=3600 overSampling=0 8: R=9000 overSampling=0 9: R=18000 overSampling=0 10: R=36000 overSampling=0 11: R=90000 overSampling=0 Starting sanity Check Check ok read Offset =0x4 Starting DSO... Setting new GainRange=7 Adc : Asked for fq=20000 got fq=20000 intDiv:0 intFrac=3600 New timebase=6 : 1ms, fq=20000 Cannot read invert setting Loading calibration data Cannot load AC calibration Adc : Asked for fq=1000 got fq=1000 intDiv:1 intFrac=6464 Setting new GainRange=0 Starting ADC...

With the previous firmware we got to GainRange=1... but with this one we are again stuck at GainRange=0

I programmed it several times, even doing a full wipe and reinstalling the bootloader just in case... but there were no differences... except for the "sanity check" part.

On the first boot after full wipe, in that "section" the message is different ... 11: R=90000 overSampling=0 No valid sector found, reformatting Nvm not operational, reformatting... Starting DSO... ... I understand that it is normal for the first start. When restarting it already starts with the sequence that I put above

ShaviTF avatar Oct 17 '22 08:10 ShaviTF

Would it be possible for you to get a st linkv 2 clone and upload that way ? ( a clone is ~ 2$ or so)

I tried with DSO based on CH32/STM32/GD32 with all the versions i provided, they all work fine. The only difference is the way you flash it so far

If you happen to have a bluepill board, you can put the blackmagic software on it temporarily to flash the DSO

mean00 avatar Oct 17 '22 11:10 mean00

Hi, I have the exact same issue, I flashing with blackmagic (using blackmagic-bluepill).

Hanging at DC Calibration

Flashed with: bootloader_2.2.elf lnDSO_JYETECH_2.2.elf

~The only issue that I have is that it seams that the erase does not work: After erase, the DSO boot normally to the calibration screen.~ Update: erase work with the gbd command monitor erase_mass, reboot to a white screen. Re flashing and the same issue is here, still hanging at DC calibration.

Sebclem avatar Nov 08 '22 16:11 Sebclem

That one may work nocal5.zip

@mean00 Can you upload the elf of this, so I can test it.

Sebclem avatar Nov 08 '22 16:11 Sebclem

Please find cal6 attached, should be similar to cal5 When it is stuck, it would be interesting to see if it crashed i.e. the output of the 'bt' command cal6.zip

mean00 avatar Nov 08 '22 17:11 mean00

  • be absolutely sure it is not a FNIRSI PCB

mean00 avatar Nov 08 '22 17:11 mean00

It seam to be a FNIRSI but with STM32 F103C8T6: (Ordered in 2021) image PXL_20221108_182006798

I have tried before with the FNIRSI efi but the Ok button seam to no not work.

I'm trying the cal6.

Sebclem avatar Nov 08 '22 18:11 Sebclem

The main diff between FNIRSI and non FNIRSI :

  • the detection of AC/DC/GND
  • the test signal range is hardwired to 0..3.3 v on FNIRSI

So if the fw can detect the AC/DC/GND switch position, you have the correct fw for that board

mean00 avatar Nov 08 '22 18:11 mean00

Serial logs:

Setuping up DSO...
0: R=18 overSampling=0
1: R=36 overSampling=0
2: R=90 overSampling=0
3: R=180 overSampling=0
4: R=360 overSampling=0
5: R=900 overSampling=0
6: R=1800 overSampling=0
7: R=3600 overSampling=0
8: R=9000 overSampling=0
9: R=18000 overSampling=0
10: R=36000 overSampling=0
11: R=90000 overSampling=0
Starting sanity Check
Check ok
read Offset =0x4
Starting DSO...
Setting new GainRange=7
Adc : Asked for fq=20000 got fq=20000
intDiv:0 intFrac=3600
New timebase=6 : 1ms, fq=20000
Cannot read invert setting
Loading calibration data
Cannot load AC calibration
Adc : Asked for fq=1000 got fq=1000
intDiv:1 intFrac=6464
Setting new GainRange=0
Starting ADC...

gdb :

(gdb) target extended-remote COM4
Remote debugging using COM4
(gdb) mon swdp_scan
Target voltage: 3.26V
Available Targets:
No. Att Driver
 1      STM32F1 (clone) medium density M3
(gdb) attach 1
Attaching to Remote target
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x08004e92 in ?? ()
(gdb) bt
#0  0x08004e92 in ?? ()
#1  0x08005668 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) file cal6.elf
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from cal6.elf...
(gdb) bt
#0  0x08004e92 in prvCheckTasksWaitingTermination () at /home/fx/Arduino_gd32/lnDSO150/lnArduino/FreeRTOS/tasks.c:3697
#1  prvIdleTask (pvParameters=<optimized out>) at /home/fx/Arduino_gd32/lnDSO150/lnArduino/FreeRTOS/tasks.c:3447
#2  0x08005f1c in prvPortStartFirstTask () at /home/fx/Arduino_gd32/lnDSO150/lnArduino/FreeRTOS/portable/GCC/ARM_CM3/port.c:242
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

I'm no familiar with gdb, so if I have done anything in the wrong way, please tell me

Sebclem avatar Nov 08 '22 19:11 Sebclem

No, it's good :) It did not crash, it's just waiting for the ADC to say "done".

If you are ok with it, I'll create a few test programs to narrow down why the ADC is not working as expected

mean00 avatar Nov 08 '22 20:11 mean00

Could you try running the code i.e. mon swdp_scan attach 1 file cal6.elf r <== that line

it should reset then start

mean00 avatar Nov 08 '22 20:11 mean00

It look like there is no crash, the program just start and hang:

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: C:\Users\seb65\Documents\DSO\cal6.elf

But, i think the is more logs ?

Setuping up DSO...
0: R=18 overSampling=0
1: R=36 overSampling=0
2: R=90 overSampling=0
3: R=180 overSampling=0
4: R=360 overSampling=0
5: R=900 overSampling=0
6: R=1800 overSampling=0
7: R=3600 overSampling=0
8: R=9000 overSampling=0
9: R=18000 overSampling=0
10: R=36000 overSampling=0
11: R=90000 overSampling=0
Starting sanity Check
Check ok
read Offset =0x4
Starting DSO...
Setting new GainRange=7
Adc : Asked for fq=20000 got fq=20000
intDiv:0 intFrac=3600
New timebase=6 : 1ms, fq=20000
Cannot read invert setting
Loading calibration data
Cannot load AC calibration
Adc : Asked for fq=1000 got fq=1000
intDiv:1 intFrac=6464
Setting new GainRange=0
Starting ADC...
Ending ADC...
Range : 0 val=2123
Setting new GainRange=1
Starting ADC...
Ending ADC...
Range : 1 val=2173
Setting new GainRange=2
Starting ADC...

Hanging at GainRange=2 but before was GainRange=0

Sebclem avatar Nov 08 '22 21:11 Sebclem