Forum > Embedded - ARM

Arduino DUE

<< < (3/5) > >>

MiR:
I think I got it right now using bossash:

I have USB connected to the programming port, then I press erase button and connect via bossash 1.9.1: (remember to replace connect with the matching command for linux-device)


--- Code: ---./bossash
Press Ctrl-D or enter "exit" to end session.
Enter "help" to display a command list.
bossa>  connect /dev/cu.usbmodem14401
Connected to device on /dev/cu.usbmodem14401
bossa>  dump 0x80000 0x8
            0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00080000 | ff ff ff ff ff ff ff ff                         | ��������
bossa>  write Project1.bin
Write 541 bytes to flash (3 pages)
[==============================] 100% (3/3 pages)
Write successful
bossa>  dump 0x80000 0x10
            0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00080000 | 00 00 01 20 91 01 08 00 8d 01 08 00 00 00 00 00 | ... ............
bossa> bootf true
Boot to flash flag set to true
bossa> options
bossa>  reset

--- End code ---

I guess starting from here it should be possible (for you) to find a way to consistently do the same things with bossac.

Or buy a JLink Edu Mini for €20 and enjoy real flashing and debugging....

attached my code, fex experiments inside, I guess the real winner was using the 'options' command to actually save the boot from flash mode.....

Mathias:
When I just switched on my PC earlier, I was able to upload the project of your last post right away. Only the LED flashed every 30 seconds.
After later attempts it worked again.

With an ST32 you enter 0x8000000, doesn't the DUO also need something similar?

--- Code: ---st-flash write stm32Blink.bin 0x8000000
--- End code ---
When I look at the following file in the FPC sources, line 1024, the DUO also has a flasbase value.
/home/tux/fpcupdeluxe_stm32/fpcsrc/compiler/arm/cpuinfo.pas

Something else, why doesn't the Arduino IDE bother whom dor bossac is called?

MiR:
The Flash offset of the Arduino Due is $00080000 this is what is also set in cpuinfo.pas:

      (controllertypestr:'ATSAM3X8E';     controllerunitstr:'SAM3X8E'; cputype:cpu_armv7m; fputype:fpu_soft; flashbase:$00080000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
      (controllertypestr:'ARDUINO_DUE';   controllerunitstr:'SAM3X8E'; cputype:cpu_armv7m; fputype:fpu_soft; flashbase:$00080000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),

so there is no reason to set an offset for compilation.

What I saw is that in the cases where the app would not start the debugger stopped inside of the boot-rom, this is why I investigated if the boot option is properly set.

I guess what you can also do is to flash with bossac, then start bossash, set the flash boot, do option and reset. Chances are good that after this the app runs. for me it worked every time I flashed with the bossash shell steps I described.

Why it does not work for Arduino Due directly with bossac.... I have no clue....

Mathias:
Somehow I have the feeling that Arduino is building the bin file very differently than FPC does.
See the following editions:

Arduino:
--- Code: ---$ /home/tux/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino/bossac --port=ttyACM0 -U false -e -w -v -b /tmp/arduino_build_309523/Blink.ino.bin -R
Atmel SMART device 0x285e0a60 found
Erase flash
done in 0.037 seconds

Write 11864 bytes to flash (47 pages)
[==============================] 100% (47/47 pages)
done in 2.294 seconds

Verify 11864 bytes of flash
[==============================] 100% (47/47 pages)
Verify successful
done in 2.122 seconds
Set boot flash true
CPU reset.
--- End code ---
Project.bin:

--- Code: ---/n4800/DATEN/Programmierung/Lazarus/Tutorials/Embedded/ARM/Arduino_DUE/von_MIR$ /home/tux/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino/bossac --port=ttyACM0 -U false -e -w -v -b /n4800/DATEN/Programmierung/Lazarus/Tutorials/Embedded/ARM/Arduino_DUE/von_MIR/Project1.bin -R
Atmel SMART device 0x285e0a60 found
Erase flash
done in 0.037 seconds

Write 552 bytes to flash (3 pages)
Gleitkomma-Ausnahme (Speicherabzug geschrieben)
--- End code ---

Mathias:
Which is also strange, if I try to upload the "am" from Arduino with bassac 1.9.1 it doesn't work either.
Bassac 1.6.1 works without any problems. Assuming I reset the com port beforehand.

To make it easier, I've written a utility program:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.DUEClick(Sender: TObject);const  bos161 = '/home/tux/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino/bossac';  bos191 = '/home/tux/Schreibtisch/BOSSA-1.9.1/bin/bossac';  binMIR = '/n4800/DATEN/Programmierung/Lazarus/Tutorials/Embedded/ARM/Arduino_DUE/von_MIR/Project1.bin';  binArduino = '/tmp/arduino_build_303924/Blink.ino.bin';  com = 'ttyACM0';var  SerialHandle: TSerialHandle;begin  if not Assigned(RunCommandForm) then begin    RunCommandForm := TRun_Command_Form.Create(nil);  end;   SerialHandle := SerOpen('/dev/' + com);  SerSetParams(SerialHandle, 1200, 8, NoneParity, 1, []);   SerSetDTR(SerialHandle, True);  SerSetDTR(SerialHandle, False);  Sleep(500);  SerClose(SerialHandle);  Sleep(500); //  RunCommandForm.RunCommand(bos191 + ' --port=' + com + ' -U false -e -w -v -b ' + binArduino + ' -R');  RunCommandForm.RunCommand(bos191 + ' -e -w -v -b ' + binArduino + ' -R'); end;  
What is also strange, if I try to upload the "am" from Arduino with bossac 1.9.1, it doesn't work either.
With bossac 1.6.1 there is no problem. Assuming I reset the com port beforehand.

To make it easier, I've written a utility program:

By the way, whoever I try with sleober (Arduino plugin for Eclipse) doesn't want the DUE either, although bossac 1.6.1 is used there.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version