platformio / platform-shakti

Shakti: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/shakti
Apache License 2.0
28 stars 8 forks source link

Custom Upload Command #5

Closed johnnavaj closed 5 years ago

johnnavaj commented 5 years ago

Regarding the upload protocol statement for PIO , i have detailed the issue below.

Observation 1 : With "upload_protocol=custom" I am able to upload and debug well. Debug-working-new

Debugging the Program Debugging-final

Observation 2 : Without "upload_protocol=custom" it doesn't upload. upload not working

What i feel is if we don't give the custom part, it tries to program flash instead.

valeros commented 5 years ago

I'm not sure you were able to upload your firmware using the custom protocol as there is no implementation for UPLOADCMD in this case, there was only SUCCESS message without proper uploading to the target. It's interesting why it works if you upload your code during debug session, but fails when you try to flash it directly over openocd as they are basically using the same elf file.

How do you usually upload code to the board?

johnnavaj commented 5 years ago

We use FTDI (USB-UART) enabled OpenOCD also the bitstream has ftdi enabled , so you can write directly with the help of GDB once the target is intialized in the openocd session.

johnnavaj commented 5 years ago

Yes as pointed out it uploads only in the debug section but i can't proceed to debug without doing the upload command.

valeros commented 5 years ago

You are using GDB even for a simple upload? Could you please open this file: ~/.platformio/platforms/shakti/builder/main.py and change line #150

 "-c", "program {$SOURCE} %s verify; shutdown;

to this one:

 "-c", "init; load_image {$SOURCE} %s reset; shutdown;"
johnnavaj commented 5 years ago

For load_image , reset works ? It will return invalid command for reset in the above case.

valeros commented 5 years ago

@johnnavaj Unfortunately I don't have this board to test, so I hoped that you would tell me. Did it write the image? Could you try to remove reset command? What was printed in the log?

johnnavaj commented 5 years ago

try

Can you tell me what happens when you execute "Start Debbugging" so i can compare the two command line parameter execution phases.

valeros commented 5 years ago

The default workflow is the next:

johnnavaj commented 5 years ago

My bad i started debugging after doing upload thats why its showing there. Otherwise its the same only . YAY! Removing the reset works. Thanks.

But for monitor , where can replicate the continue command ?

valeros commented 5 years ago
But for monitor , where can replicate the continue command ?

What do you mean?

johnnavaj commented 5 years ago

Like for auto executing the program and getting the output on the miniterm

On Mon, 5 Aug 2019 at 2:07 PM, Valerii Koval notifications@github.com wrote:

But for monitor , where can replicate the continue command ?

What do you mean?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/platformio/platform-shakti/issues/5?email_source=notifications&email_token=AHPJYREZLMG6G4FPBKDZJA3QC7RGLA5CNFSM4II2TUSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3RDLQY#issuecomment-518141379, or mute the thread https://github.com/notifications/unsubscribe-auth/AHPJYRFJFKV65GR7GONLE6DQC7RGLANCNFSM4II2TUSA .

valeros commented 5 years ago

As you saw, reset command doesn't work, so the only way is to reset the board and open terminal manually.

johnnavaj commented 5 years ago

Yep, talked to hardware team. So for now it can be written to TCM or RAM and Contunue Command will be executed in the debug session which in turn would produce O/P in the monitor. Will integrate qspi and test the flash write. Thanks a ton for your help.

johnnavaj commented 5 years ago

can i create a PR for updating the command for now ? to solve the custom upload command ? @valeros

valeros commented 5 years ago

Sure thing and feel free to close this issue if the problem is resolved.

johnnavaj commented 5 years ago

Sure.