DSOQuadV2.6 RESOURCE(Update 2012/04/12)

It’s now much harder for me to fix that, since I can’t reproduce the issue. :frowning:

The problem I fixed actually had to do with an un-initiallized variable, not with configuration settings, although I also had issues when the configuration wasn’t valid.
There are quite possibly(/definitely) other un-initialized vars causing issues in other situations :confused:

PS: if you can, try this: in Marco’s app, save settings while using the 1-page-buffer mode.
Then re-install this.
I had very different behavior in the 2 modes before.

Just tried it, same result as before.

What I don’t understand is why Marco’s HEX has no problem and yours crashes.

SUMMARY:

  • Marco’s APP as HEX (compiled using HIS toolchain): OK
  • Marco’s APP compiled by myself using GCC: NOK
  • Pedro’s APP as HEX: NOK
  • Original firmware compiled by myself using GCC (Gabonator’s port) in slot 3: OK

Do you have reports from other users with success/failure?

When I find time, I will try the “caveman” debugging method too, putting “printf…” everywhere in your code to find where it crashes.

Anyways, thank you for your work.

Patrick

Patrick,

From what I gathered up to now, the problem seems to be in the variables initialization behaviour, or lack of proper initialization.

Example: the fix I did in v1.3 simply involved initializing FrameMode to 0 at creation.
FrameMode as 3 valid values 0, 1 and 2.
At program start, sometimes the var would have a value of 0, but sometimes it would have another higher value, outside of it’s allowed scope, which would then cause a bad calculation of the size of the capture buffer, and would make the whole thing freeze in the FOR loop in process.c that cycles through the buffer.

I would expect the variables to be properly initialized by the code, but apparently, GCC is having a different behaviour than IAR regarding this.
Then again, it’s been too long since my C coding days.

This issue is “in line” with the different behaviour when compiling with or without the -fno-common flag.
Perhaps there’s a different compile option controlling this…

here we go again:

github.com/pmos69/dso203_gcc

v1.4

  • changed compile options: “-O3” replaced by “-O0 -fno-common -fzero-initialized-in-bss”
  • removed explicit initialization of the FrameMode variable

Everything still works for me, even without the explicit initialization of FrameMode.
Hopefully, all other vars will have the same behaviour.
dso203_gcc_v1.4.zip (336 KB)

Yes, it works now, congratulations and thank you so much!

There is still a problem with the display of channels A and B (but no crash). Both channels are grounded, the problem happens with the short as well as with the long buffer:

  • in AUTO and SCAN modes, I have huge offsets on A (e.g. 6 V on a 2V/div scale)
  • In SCAN, short buffer, sometimes it refreshes the screen several times per second with a 1s time base (!) and trigs on a square impuls of 6V (2V/div) and 1div long (synchron on both channels) - with grounded inputs…

Marco’s firmware does not show this behaviour.

Patrick

PS: when using the 10x mode, the readings on the right (Vrms and so on) are correctly multiplied by 10, but in the menu (second line), the voltage display is not. E.g. CH(A) / DC 2V, then when I chose 10x(A) I would expect “DC 20V” and not “DC 2V”. Do you understand why?

I’m now seeing this behavior as well. Didn’t happen in the previous builds.
Tried running the calibration procedure and that seems to go well, with only minor offsets detected, so something’s wrong in the other part of the code.

At least we are now seeing the same thing :slight_smile:
Predictable/reproducible behavior is a great step forward :slight_smile:

…now all it needs is a bit more love&care to squash some of those nasty bugs.

EDIT: Seems to be a question of the offsets being completely messed up.
Inputted a 2 volt square from the signal generator into chA and the signal itself is perfect in all scales…

This thing is just too big compiled with “-O0” and some vars are pointing to illegal addresses.
I got the channel A low voltage correction array in that situation. For some ranges it even has fluctuating values :confused:

I think a “-Os” compile is probably mandatory to avoid these problems, but unfortunately it’s not working for me.

Hello

I have been playing with the compiler settings with no success. The settings of jpa’s “Frequency response analyser” (CFLAGS=-Wall -Werror -mcpu=cortex-m3 -mthumb -mno-thumb-interwork -fno-common -O2 -g -std=gnu99 -I !STM_INC! -I !SRC_INC! -I !SRC_SRC!) don’t work better than -O0, no crash but totally unuseable traces.

What I don’t understand: what is the problem behind those unpredictable offsets?

  • not properly initialized variables (I learnt a long time ago that software where not every variable is properly initialized before use is scrap)? Then it should be enough to initialize them properly in the source code?
  • overlapping variables/arrays/stacks? Should not the compiler prevent that?
  • something else?

With all those cracks who wrote in the forum last year, I can’t believe that nobody understands enough about the system architecture, how the memory is organised and how the compiler works to tell us which settings are appropriate!!!

Patrick

PS: does anybody know which compilation options Marco used? I know this is not the same compiler but maybe we could learn from them?

Re-did a complete code merge of marcosin into 2.51 by hand and got it to compile with -Os :slight_smile:
Still a few problems with it, but they should be “fixable”.
Will post as asap.

This should work (hopefully)

v1.5

  • Re-did a complete code merge of marcosin 1.8 & fixes into 2.51 by hand. - Now compiles with -Os
  • X_Y modes don’t work, and mess the buffer - Reset needed to proceed after using X_Y.

The rest seems ok.
dso203_gcc_v1.5.zip (279 KB)

…well, better than 1.4 but… there is still a huge offset on CH A, as well as an impossible to understand Vpp with a DC signal. But no more random square signals.
IMAG000.jpg
I still don’t understand what happens with this processor/compiler…

can you do a calibration?

Yes, and it seems to work! Congratulations!

Do you have any idea:

  • why the fact to merge marcosin’s source code into 2.51 makes any difference compared to using marcosin’s complete source code? why does it know compile with Os?
  • why the X-Y mode don’t work? Juste merging marcosin’s code doesn’t seem to me to be a suitable explanation…

Patrick

Yes, you probably had the calibration settings messed up by the previous release.

Marco’s code doesn’t compile directly in gcc. There are a few differences between IAR and gcc source, like some datatypes.
The last version was more or less a straight port of Marco’s code to gcc, but it had issues, like you saw. (and something in the code didn’t “like” -Os).
Merging his code over the stable gcc 2.51 code I had actually involved more work/time than the previous attempt, but I knew I could control each step of the process to determine any incompatibilities with -Os.

Don’t know yet what’s the problem with X-Y part, but shouldn’t be hard to fix. (we’ve all heard that before :slight_smile: )
I have a version ready that already fixes the max, min and vpp readings, but will try to fix X-Y also before release.

AP3_P100 installed on my DS203 but when restarting it still say 2.52 and it is no change in user interface(?) SYS is 1.51.

I think it’s on slot 3, so you’ll have to power-up with button 3 (circle) pressed.

…by the way, I have just noticed that this firmware has been available since september 2011 (beta) and decembre 2011 (v1.00) on the chinese forum for the DSO203 (same as DSO Quad):

http://translate.google.com/translate?sl=auto&tl=en&u=http%3A%2F%2Fwww.minidso.com%2Fforum%2Fviewtopic.php%3Ff%3D7%26t%3D117

There you can find a version for slot 1 and a version for slot 3 as well as some explanations about the menus.

Patrick

PS: I have no idea where the source code is… on source-ds203.googlecode.com it’s still 2.51

…meanwhile, I asked if they would release the source code.

v1.6 released
https://github.com/pmos69/dso203_gcc

  • Fixed X_Y modes - now operational again
  • Fixed Min, Max and Vpp readings

Pedro
dso203_gcc_v1.6.zip (278 KB)

dso203_gcc v1.7 released
https://github.com/pmos69/dso203_gcc

  • Fixed x10 probe modes - Division scales and meter values
  • Calibration accuracy fix

Regards,
Pedro Simoes
dso203_gcc_v1.7.zip (277 KB)