-
-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use alternative protocol to upload to STM32 #175
Comments
The way I upload my code (via the CLI)
Note: |
Got it. @ivankravets any idea how to specify gdb? |
@valeros, please show @beriberikix how to create own platform using our |
Hello @beriberikix! I'll try to help you. Second step is add new board: {
"armstrap_eagle": {
"build": {
"core": "stm32",
"extra_flags": "-DSTM32F40_41xxx",
"f_cpu": "168000000L",
"ldscript": "armstrap_stm32_flash.ld",
"cpu": "cortex-m4",
"mcu": "stm32f407vet6",
"variant": "stm32f4"
},
"frameworks": ["cmsis", "spl", "libopencm3", "mbed"],
"name": "Armstrap Eagle",
"platform": "ststm32gdb",
"upload": {
"maximum_ram_size": 196608,
"maximum_size": 524288
},
"url": "http://docs.armstrap.org/en/latest/hardware-overview.html",
"vendor": "Armstrap"
}
} Third step is add a new ldscript for armstrap board to this package After these steps, you can try to upload your firmware with next command: Unfortunately, I don't have board to check this aproach, but in theory it should work. |
Thanks for the detailed steps! When I tried installing the platform, I get an error (see below.) It appears as if the directory is not being discovered on my Mac. Do I need to add anything in addition to my $PATH?
|
This bug fixed in platformio2_0 branch. |
It installs! I'm so close, but I have 1 issue left (might be a general PlatformIO question.) Using the Blinky sample from Armstrap, I get a compile error that it cannot find the periperhal import, whether I place it in the libs folder or directly in the src (see below.) Suggestions? I didn't see an include section mentioned in the platform.ini docs. Also, maybe this is a n00b question but shouldn't installing a platform also download the peripherals?
|
Try this
|
Ah, makes sense! Got the success message. I will try uploading it tonight when I get home from work. Thanks again. |
Is this an SCons error?
|
Please, try updated version ststm32dgb-builder.py: |
That did the trick @valeros! I now have BLINKENLICHTEN 🔅 🔆 🔅 As an aside, the executable hangs until I forcibly quit (see ^C in output below) and the firmware doesn't re-run when I power cycle the unit. I was having the same problem when I was using my Makefile, so I can take that issue back to the @armstrap Forum.
|
Nice! |
Ah, that makes sense. @ work but will try again tonight! |
No luck.
|
About firmware re-run: |
Just replace that in ststm32gdb-builder.py, right? Question - to update this file all I'm doing is deleting the *.pyc and re-runinng
|
Yes, just replace that line in ststm32gdb-builder.py |
Same results as before.
|
Let's try different approach.
|
Errors, though not very descriptive.
|
When I run the
|
Let's try upload with minimum set of commands:
|
No errors this time, but no blinking. @armstrap I'm using the standard sample - shouldn't the USER LED be toggling? After I flash it the LED just stays solid, no matter what value I pass into
|
The board should be blinking. |
@valeros Wouldn't the upload with minimum set of commands also include the confirmation to disconnect from the target?
Here is my output:
@beriberikix Where did you find the link to that example hosted on my s3 account? It's really old and buggy. Please consider replacing it with the one in the github repo. Or at a minimum, change void loop()
{
uint32_t counter = 0;
while (1) {
counter++;
GPIO_ResetBits(GPIOC, LEDS);
GPIO_SetBits(GPIOC, LED[counter % 2]); // ERROR 'LED' array index out of bounds
delay(250);
};
} to void loop()
{
uint32_t counter = 0;
while (1) {
counter++;
GPIO_ToggleBits(GPIOC, GPIO_Pin_1);
delay(250);
};
} to avoid the out-of-range error you are probably seeing. |
GDB does not require confirmations in batch mode.
|
@valeros You are correct! Sorry about that. I had to remove the
Here is the output when I have the gdb
|
@armstrap Unfortunately, I don't have any armstrap board, maybe @beriberikix can test it. |
@armstrap using togglebits fixed it! I originally downloaded it from the Getting Started guide So to recap:
Thanks for the help! Is it possible to roll the gdb commands back into the builder script for future users? |
Add GDB as alternative uploader to ststm32 platform // Resolve #175
I recently got the @armstrap, which is a
STM32F407VET6
with a built-in JTAG powered by a @blacksphere Black Magic. To test it out quickly with platformio, I used thedisco_f407vg
since it is also a f407. However, the configuration looks for ST-Link and fails. I'm not too familiar with the Black Magic, so I'm not positive what it needs.That said, how do I specify another means to upload? I found the
upload_protocol
field, but the possible values aren't documented.Thanks!
The text was updated successfully, but these errors were encountered: