Skip to content
Snippets Groups Projects
Commit 581f6db0 authored by cnlohr's avatar cnlohr
Browse files

* Switch to -a from -h because -h is help.

 * In unbrick mode, revert previous change that left the processor hanging.
parent fe86ce83
No related branches found
No related tags found
No related merge requests found
......@@ -14,18 +14,22 @@ The exe here is about 12kB and contains everything except for the libusb driver.
Usage: minichlink [args]
single-letter args may be combined, i.e. -3r
multi-part args cannot.
-3 Enable 3.3V
-5 Enable 5V
-t Disable 3.3V
-f Disable 5V
-r Release from reest
-R Place into Reset
-D Configure NRST as GPIO **WARNING** If you do this and you reconfig
the SWIO pin (PD1) on boot, your part can never again be programmed!
-d Configure NRST as NRST
-w [binary image to write]
-s [debug register] [value]
-g [debug register]
-o [memory address, decimal or 0x, try 0x08000000] [size, decimal or 0x, try 16384] [output binary image]
-3 Enable 3.3V
-5 Enable 5V
-t Disable 3.3V
-f Disable 5V
-u Clear all code flash - by power off (also can unbrick)
-b Reboot out of Halt
-e Resume from halt
-a Place into Halt
-D Configure NRST as GPIO
-d Configure NRST as NRST
-s [debug register] [value]
-g [debug register]
-w [binary image to write] [address, decimal or 0x, try0x08000000]
-r [output binary image] [memory address, decimal or 0x, try 0x08000000] [size, decimal or 0x, try 16384]
Note: for memory addresses, you can use 'flash' 'launcher' 'bootloader' 'option' 'ram' and say "ram+0x10" for instance
For filename, you can use - for raw or + for hex.
-T is a terminal. This MUST be the last argument.
```
......@@ -46,6 +46,9 @@ int main( int argc, char ** argv )
int skip_startup =
(argc > 1 && argv[1][0] == '-' && argv[1][1] == 'u' ) |
(argc > 1 && argv[1][0] == '-' && argv[1][1] == 'h' ) |
(argc > 1 && argv[1][0] == '-' && argv[1][1] == 't' ) |
(argc > 1 && argv[1][0] == '-' && argv[1][1] == 'f' ) |
(argc > 1 && argv[1][0] == '-' && argv[1][1] == 'X' );
if( !skip_startup && MCF.SetupInterface )
......@@ -83,6 +86,7 @@ keep_going:
{
default:
fprintf( stderr, "Error: Unknown command %c\n", argchar[1] );
case 'h':
goto help;
case '3':
if( MCF.Control3v3 )
......@@ -136,7 +140,7 @@ keep_going:
if( !MCF.Erase || MCF.Erase( dev, 0, 0, 1 ) )
goto unimplemented;
break;
case 'h':
case 'a':
if( !MCF.HaltMode || MCF.HaltMode( dev, 0 ) )
goto unimplemented;
break;
......@@ -466,7 +470,7 @@ help:
fprintf( stderr, " -u Clear all code flash - by power off (also can unbrick)\n" );
fprintf( stderr, " -b Reboot out of Halt\n" );
fprintf( stderr, " -e Resume from halt\n" );
fprintf( stderr, " -h Place into Halt\n" );
fprintf( stderr, " -a Place into Halt\n" );
fprintf( stderr, " -D Configure NRST as GPIO\n" );
fprintf( stderr, " -d Configure NRST as NRST\n" );
fprintf( stderr, " -s [debug register] [value]\n" );
......@@ -1158,7 +1162,8 @@ int DefaultUnbrick( void * dev )
MCF.WriteReg32( dev, DMCONTROL, 0x80000001 );
// Many times we would clear the halt request, but in this case, we want to just leave it here, to prevent it from booting.
// MCF.WriteReg32( dev, DMCONTROL, 0x00000001 ); // Clear Halt Request.
// TODO: Experiment and see if this is needed/wanted in cases. NOTE: If you don't clear halt request, progarmmers can get stuck.
MCF.WriteReg32( dev, DMCONTROL, 0x00000001 ); // Clear Halt Request.
MCF.FlushLLCommands( dev );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment