Jump to content

Hard Fault during NGL upload


Duggle

Recommended Posts

I've suddenly started to experience Hard faults that appear to be happening during the NGL loading phase.

LCD 1 says:

!! HARD FAULT !!
at PC=0x0000011b

 

gallery_3440_57_31085.png

Up until this morning the whole batch upload of NG files has been extremely smooth.

I have only been playing with a couple of lines of my NGC around triggering a RunSection.

 

After the Hard fault, and power cycling, the NGL is present but empty.

I repeat the batch upload (which re-writes the Default NGC,NGL, NGR files all at once) and the midi box fuctions normally.

I repeat the batch upload again, and this time it Hard Faults, this time at 18%.

Power cycle.

Upload works.

Next upload HardFaults.

etc,etc.

So the pattern is that the upload after powercycle works, the next one fails.

 

OK (I think) I've found a cause!!!

Last night I had introduced a routine in ^Section == 0 that flashed some LEDs.

With this removed the problem has gone.

It is very confusing because the problem only manifests on the second upload process after each power cycle.

With the RunSection:0 removed I have uploaded repeatedly without the return of this problem.

 

It seems as though having executed at ^Section == 0 leaves the environment corrupted in some way?

 

 

 

Link to comment
Share on other sites

Ok, I've stripped down my NG files (a lot!).  Unfortunately, it now requires around 6 to 13(?) downloads before a crash. It is, from what I can tell, very repeatable though.

 RESET_HW
LCD "%C"
#Bank selection
EVENT_BUTTON id=8  fwd_id=LED:33 type=Meta meta=SetBank button_mode=OnOnly range=1:1 radio_group=1   value=1 
EVENT_BUTTON id=7  fwd_id=LED:34 type=Meta meta=SetBank button_mode=OnOnly range=2:2 radio_group=1 
EVENT_BUTTON id=6  fwd_id=LED:35 type=Meta meta=SetBank button_mode=OnOnly range=3:3 radio_group=1 
EVENT_BUTTON id=5  fwd_id=LED:36 type=Meta meta=SetBank button_mode=OnOnly range=4:4 radio_group=1 
#rgbled
 DOUT_MATRIX n=1  rows=4  inverted=1  sr_dout_sel1=1  sr_dout_r1=2 sr_dout_r2=5  sr_dout_g1=3 sr_dout_g2=6 sr_dout_b1=4 sr_dout_b2=7  led_emu_id_offset=1001

EVENT_LED value=127 id=1001 bank=1  rgb=15:0:0
EVENT_LED value=127 id=1002 bank=1  rgb=15:0:0
EVENT_LED value=127 id=1017 bank=1  rgb=15:0:0
EVENT_LED value=127 id=1018 bank=1  rgb=15:0:0
EVENT_LED value=127 id=1033 bank=1  rgb=15:0:0
EVENT_LED value=127 id=1034 bank=1  rgb=3:3:3
EVENT_LED value=127 id=1003 bank=1  rgb=15:5:0
EVENT_LED value=127 id=1004 bank=1  rgb=15:5:0

EVENT_LED value=127 id=1019 bank=1  rgb=15:5:0
EVENT_LED value=127 id=1020 bank=1  rgb=15:5:0
EVENT_LED value=127 id=1035 bank=1  rgb=15:5:0
EVENT_LED value=127 id=1036 bank=1  rgb=15:5:0
EVENT_LED value=127 id=1049 bank=1  rgb=15:5:0
EVENT_LED value=127 id=1050 bank=1  rgb=15:5:0
EVENT_LED value=127 id=1051 bank=1  rgb=15:5:0
EVENT_LED value=127 id=1009 bank=1  rgb=15:5:0

EVENT_LED value=127 id=1010 bank=1  rgb=15:5:0
EVENT_LED value=127 id=1005 bank=1  rgb=15:7:0
EVENT_LED value=127 id=1021 bank=1  rgb=15:7:0
EVENT_LED value=127 id=1037 bank=1  rgb=15:7:0
EVENT_LED value=127 id=1053 bank=1  rgb=15:7:0
EVENT_LED value=127 id=1013 bank=1  rgb=15:7:0
EVENT_LED value=127 id=1006 bank=1  rgb=7:15:0
EVENT_LED value=127 id=1022 bank=1  rgb=7:15:0

EVENT_LED value=127 id=1038 bank=1  rgb=7:15:0
EVENT_LED value=127 id=1054 bank=1  rgb=7:15:0
EVENT_LED value=127 id=1014 bank=1  rgb=7:15:0
EVENT_LED value=127 id=1052 bank=1  rgb=7:15:0
EVENT_LED value=127 id=1011 bank=1  rgb=7:15:0
EVENT_LED value=127 id=1012 bank=1  rgb=7:15:0
EVENT_LED value=127 id=1007 bank=1  rgb=0:15:0
EVENT_LED value=127 id=1023 bank=1  rgb=0:15:0

EVENT_LED value=127 id=1039 bank=1  rgb=0:15:0
EVENT_LED value=127 id=1055 bank=1  rgb=0:15:0
EVENT_LED value=127 id=1015 bank=1  rgb=0:15:0
EVENT_LED value=127 id=1008 bank=1  rgb=0:15:3
EVENT_LED value=127 id=1024 bank=1  rgb=0:15:3
EVENT_LED value=127 id=1040 bank=1  rgb=0:15:3
EVENT_LED value=127 id=1056 bank=1  rgb=0:15:3
EVENT_LED value=127 id=1016 bank=1  rgb=0:15:3

EVENT_LED value=127 id=1025 bank=1  rgb=15:0:3 
EVENT_LED value=127 id=1041 bank=1  rgb=15:0:3 
EVENT_LED value=127 id=1057 bank=1  rgb=15:0:3 
EVENT_LED value=127 id=1026 bank=1  rgb=15:0:3 
EVENT_LED value=127 id=1042 bank=1  rgb=7:0:15 
EVENT_LED value=127 id=1058 bank=1  rgb=7:0:15 
EVENT_LED value=127 id=1027 bank=1  rgb=3:0:15
EVENT_LED value=127 id=1043 bank=1  rgb=3:0:15

EVENT_LED value=127 id=1059 bank=1  rgb=3:0:15
EVENT_LED value=127 id=1028 bank=1  rgb=0:7:7
EVENT_LED value=127 id=1044 bank=1  rgb=0:7:7
EVENT_LED value=127 id=1060 bank=1  rgb=0:3:15
EVENT_LED value=127 id=1029 bank=1  rgb=0:7:7
EVENT_LED value=127 id=1045 bank=1  rgb=0:7:7
EVENT_LED value=127 id=1061 bank=1  rgb=0:7:7
EVENT_LED value=127 id=1030 bank=1  rgb=0:7:7

EVENT_LED value=127 id=1046 bank=1  rgb=0:7:7
EVENT_LED value=127 id=1062 bank=1  rgb=0:7:7
EVENT_LED value=127 id=1031 bank=1  rgb=0:7:7
EVENT_LED value=127 id=1047 bank=1  rgb=3:3:3
EVENT_LED value=127 id=1063 bank=1  rgb=3:3:3
EVENT_LED value=127 id=1032 bank=1  rgb=0:0:15
EVENT_LED value=127 id=1048 bank=1  rgb=0:0:15
EVENT_LED value=127 id=1064 bank=1  rgb=0:0:15

EVENT_LED id=2000 fwd_to_lcd=1 bank=1 lcd_pos=1:1:1 label="^HdBank1"

##commenting out the remaining lines seems to fix the crashes

EVENT_LED id=2000 fwd_to_lcd=1 bank=2 lcd_pos=1:1:1 label="^HdBank2"
EVENT_LED id=2000 fwd_to_lcd=1 bank=3 lcd_pos=1:1:1 label="^HdBank3"
EVENT_LED id=2000 fwd_to_lcd=1 bank=4 lcd_pos=1:1:1 label="^HdBank4" 

NGL:

LABEL HdBank1 "@(24:1:1)  OSCILLATOR 1  @(2:1:1)  OSCILLATOR 2  @(3:1:1)FILTER1 @(3:9:1) FILTER2@(4:1:1)Filter ADSR  Amp@(17:1:2)OSC3     SUB    @(18:1:2)MIXER  @(18:9:2)VELOCITY@(19:1:2)    VELOCITY@(20:1:2) OSC    @(20:9:2) MISC  "
LABEL HdBank2 " "
LABEL HdBank3 " "
LABEL HdBank4 " "

NGR (when the runsection in 0 is enabled the crash can happen....)

 
if ^section == 0
exec_meta RunSection:2 
exit
endif

if ^section == 15

    LCD "@(1:1:1)about to..."  
	LOG "about to..."
    delay_ms 1000
	LCD "@(1:1:1)    dump       "  
	LOG "dump"
	
exit
endif

if ^section == 2
set LED:1049 127
set_rgb (id)LED:1049 15:0:0;
delay_ms 100
set LED:1050 127
set_rgb (id)LED:1050 15:0:0;
set LED:1049 127
set_rgb (id)LED:1049 15:3:0;
delay_ms 100
set LED:1051 127
set_rgb (id)LED:1051 15:0:0;
set LED:1050 127
set_rgb (id)LED:1050 15:3:0;
set LED:1049 127
set_rgb (id)LED:1049 15:5:0;
delay_ms 100
set LED:1052 127
set_rgb (id)LED:1052 15:0:0;
set LED:1051 127
set_rgb (id)LED:1051 15:3:0;
set LED:1050 127
set_rgb (id)LED:1050 15:5:0;
set LED:1049 127
set_rgb (id)LED:1049 15:7:0;
delay_ms 100
set LED:1053 127
set_rgb (id)LED:1053 15:0:0;
set LED:1052 127
set_rgb (id)LED:1052 15:3:0;
set LED:1051 127
set_rgb (id)LED:1051 15:5:0;
set LED:1050 127
set_rgb (id)LED:1050 15:7:0;
set LED:1049 127
set_rgb (id)LED:1049 3:15:0;
delay_ms 100
set LED:1054 127
set_rgb (id)LED:1054 15:0:0;
set LED:1053 127
set_rgb (id)LED:1053 15:3:0;
set LED:1052 127
set_rgb (id)LED:1052 15:5:0;
set LED:1051 127
set_rgb (id)LED:1051 15:7:0;
set LED:1050 127
set_rgb (id)LED:1050 3:15:0;
set LED:1049 127
set_rgb (id)LED:1049 3:15:3;
delay_ms 100
set LED:1055 127
set_rgb (id)LED:1055 15:0:0;
set LED:1054 127
set_rgb (id)LED:1054 15:3:0;
set LED:1053 127
set_rgb (id)LED:1053 15:5:0;
set LED:1052 127
set_rgb (id)LED:1052 15:7:0;
set LED:1051 127
set_rgb (id)LED:1051 3:15:0;
set LED:1050 127
set_rgb (id)LED:1050 3:15:3;
set LED:1049 127
set_rgb (id)LED:1049 0:15:0;
delay_ms 100
set LED:1056 127
set_rgb (id)LED:1056 15:0:0;
set LED:1055 127
set_rgb (id)LED:1055 15:3:0;
set LED:1054 127
set_rgb (id)LED:1054 15:5:0;
set LED:1053 127
set_rgb (id)LED:1053 15:7:0;
set LED:1052 127
set_rgb (id)LED:1052 3:15:0;
set LED:1051 127
set_rgb (id)LED:1051 3:15:3;
set LED:1050 127
set_rgb (id)LED:1050 0:15:0;
set LED:1049 127
set_rgb (id)LED:1049 0:15:3;
delay_ms 100
set LED:1056 127
set_rgb (id)LED:1056 15:3:0;
set LED:1055 127
set_rgb (id)LED:1055 15:5:0;
set LED:1054 127
set_rgb (id)LED:1054 15:7:0;
set LED:1053 127
set_rgb (id)LED:1053 3:15:0;
set LED:1052 127
set_rgb (id)LED:1052 3:15:3;
set LED:1051 127
set_rgb (id)LED:1051 0:15:0;
set LED:1050 127
set_rgb (id)LED:1050 0:15:3;
set LED:1049 127
set_rgb (id)LED:1049 0:7:7;
delay_ms 100
set LED:1056 127
set_rgb (id)LED:1056 15:5:0;
set LED:1055 127
set_rgb (id)LED:1055 15:7:0;
set LED:1054 127
set_rgb (id)LED:1054 3:15:0;
set LED:1053 127
set_rgb (id)LED:1053 3:15:3;
set LED:1052 127
set_rgb (id)LED:1052 0:15:0;
set LED:1051 127
set_rgb (id)LED:1051 0:15:3;
set LED:1050 127
set_rgb (id)LED:1050 0:7:7;
set LED:1049 127
set_rgb (id)LED:1049 0:3:15;
delay_ms 100
set LED:1056 127
set_rgb (id)LED:1056 15:7:0;
set LED:1055 127
set_rgb (id)LED:1055 3:15:0;
set LED:1054 127
set_rgb (id)LED:1054 3:15:3;
set LED:1053 127
set_rgb (id)LED:1053 0:15:0;
set LED:1052 127
set_rgb (id)LED:1052 0:15:3;
set LED:1051 127
set_rgb (id)LED:1051 0:7:7;
set LED:1050 127
set_rgb (id)LED:1050 0:3:15;
set LED:1049 127
set_rgb (id)LED:1049 0:0:15;
delay_ms 100
set LED:1056 127
set_rgb (id)LED:1056 3:15:0;
set LED:1055 127
set_rgb (id)LED:1055 3:15:3;
set LED:1054 127
set_rgb (id)LED:1054 0:15:0;
set LED:1053 127
set_rgb (id)LED:1053 0:15:3;
set LED:1052 127
set_rgb (id)LED:1052 0:7:7;
set LED:1051 127
set_rgb (id)LED:1051 0:3:15;
set LED:1050 127
set_rgb (id)LED:1050 0:0:15;
set LED:1049 127
set_rgb (id)LED:1049 3:0:15;
delay_ms 100
set LED:1056 127
set_rgb (id)LED:1056 3:15:3;
set LED:1055 127
set_rgb (id)LED:1055 0:15:0;
set LED:1054 127
set_rgb (id)LED:1054 0:15:3;
set LED:1053 127
set_rgb (id)LED:1053 0:7:7;
set LED:1052 127
set_rgb (id)LED:1052 0:3:15;
set LED:1051 127
set_rgb (id)LED:1051 0:0:15;
set LED:1050 127
set_rgb (id)LED:1050 3:0:15;
set LED:1049 127
set_rgb (id)LED:1049 7:0:15 ;
delay_ms 100
set LED:1056 127
set_rgb (id)LED:1056 0:15:0;
set LED:1055 127
set_rgb (id)LED:1055 0:15:3;
set LED:1054 127
set_rgb (id)LED:1054 0:7:7;
set LED:1053 127
set_rgb (id)LED:1053 0:3:15;
set LED:1052 127
set_rgb (id)LED:1052 0:0:15;
set LED:1051 127
set_rgb (id)LED:1051 3:0:15;
set LED:1050 127
set_rgb (id)LED:1050 7:0:15 ;
set LED:1049 127
set_rgb (id)LED:1049 15:0:15 ;
exit
endif

finally here's the upload batch file:

Mios_Studio --batch --upload_file=default.ngc --upload_file=default.ngl --upload_file=default.ngr 

 

 

Link to comment
Share on other sites

Thanks!

I was able to reproduce the issue, and think that it was related to a MIDI OUT access conflict.

The .NGR execution is protected with a MUTEX_MIDI_OUT now, and this seems to help.

 

Could you please try the latest version in the repository at your side?

 

Best Regards, Thorsten.

Link to comment
Share on other sites

This is probably related to a race condition while loading the files.

 

Regardless of this, I wanted to allow something like

if ^section == 0
  set ^section 2
endif

 

this would solve the issue on a more elegant way.

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...