I have been trying to use the SPI on my Maple R3 board and accidentally bricked it.
Since my reset button doesn't work, I can't really figure out how to unbrick it.
Today I received 2 maple R5 RET6 ed. and tried the same code on them. Bricked!
Luckily the reset button works, and I was unable to upload new code to it (the blink sketch) which made it respond to the IDE upload command again. Phew!
going through my code I realised the following:
- calling HardwareSPI(SPI_XX, MSBFIRST, 0) works with the following SPI clockspeeds: 18MHZ, 9MHZ, 4_5MHZ, 2_25MHZ, 1_125MHZ, 562_500KHZ, 281_250KHZ.
- calling HardwareSPI(SPI_140_625KHZ, MSBFIRST, 0) bricks my board.
Changing the SPI_XX to one of the higher 7 clockspeeds, pressing the reset button and uploading, makes it work again.
Has anyone encountered the same?
bricking maple with "SPI_140_62"
(7 posts) (3 voices)-
Posted 4 years ago #
-
You're probably using SPI1. Due to hardware issues, that hardware peripheral can't be used with that speed (the bus it's on goes too fast for that). We didn't document that before, but now it's mentioned in this section:
http://leaflabs.com/docs/lang/api/hardwarespi.html#turning-the-spi-port-on
Posted 4 years ago # -
Addendum: SPI2 will go that slowly, if your application requires 140.625 KHz.
Also, just so you know, my poor heart jumps into my mouth any time I see "bricked" in the subject line of an email or forum post. The word really means "broken beyond repair", not just "temporarily messed up", so when I think I might have sent you some code that really _bricked_ your board, I feel terrible.
So please, think of your friendly coders before you post ;).
Posted 4 years ago # -
Hey mbolivar
Thank you so much for your reply.
I am sorry about my wording of the title. In my case it is practically what happened to my Maple R3 board, whose reset button doesn't work, effectually (to my knowledge) unabling me to reflash the bootloader. But the R5 is of course alright. I will refrain from using the word again, as I understand what you mean :)
Regarding the info about the SPI1 not running on that clockspeed, I am unable to see that in the documentation you linked to. Maybe I am missing the obvious, but I don't see where it is mentioned.
Thanks for your help.Best regards, Jakob
Posted 4 years ago # -
I just saw that you have updated the SPI section. Cool :)
Posted 4 years ago # -
videomusik, I am sorry to hear you were having problems with the button on Rev3. You can still reset your board via the RST pin on the bottom left header. Just ground that pin and its the same as if you had pushed reset!
Posted 4 years ago # -
Thanks poslathian. I'll give it a shot :)
And again sorry about the title of the post. Won't do that again :)Posted 4 years ago #
Reply
You must log in to post.