Search found 12 matches

by Duramaximizer
Thu May 28, 2020 5:53 pm
Forum: General Discussion and Questions
Topic: Production Code for Custom Board
Replies: 9
Views: 1131

Re: Production Code for Custom Board

I don't have anything useful to add, except that I am just starting my journey into using micropython on my own custom board. Can you please give pointers or web links to how to precompile your python and add it to the file system image? I don't care at this stage for the production deployment but ...
by Duramaximizer
Wed May 06, 2020 2:34 pm
Forum: General Discussion and Questions
Topic: How to know if I am allocating memory?
Replies: 1
Views: 195

How to know if I am allocating memory?

Hello, I have a very simple sleep function which is giving me a memory error, memory allocation failed heap if locked. I have the emergency allocation buffer enabled to get the error information. function here: def _sleep(t): stm.mem32[stm.PWR + stm.PWR_CSR] |= 1 << 8 # setup wake on rising edge PA0...
by Duramaximizer
Thu Apr 16, 2020 2:51 pm
Forum: General Discussion and Questions
Topic: Production Code for Custom Board
Replies: 9
Views: 1131

Re: Production Code for Custom Board

How would I suck a flash image out of this one unit? You can use dfu-util to read back the flash from the device. The internal flash of the pyboard is made up of the firmware and the filesystem. From dfu-util's perspective it's just bytes. Basically I need to freeze my main.py and boot.py and have ...
by Duramaximizer
Thu Apr 16, 2020 1:40 pm
Forum: General Discussion and Questions
Topic: Production Code for Custom Board
Replies: 9
Views: 1131

Re: Production Code for Custom Board

Also check this post out for ways to save/write the filesystem (can also be used to read the entire firmware image): https://forum.micropython.org/viewtopic.php?f=3&t=5877&p=33695#p33694 This is very interesting, thank you. I'm having a problem picturing how I would get my customized filesystem int...
by Duramaximizer
Thu Apr 16, 2020 1:35 pm
Forum: General Discussion and Questions
Topic: Production Code for Custom Board
Replies: 9
Views: 1131

Re: Production Code for Custom Board

Once you have your code frozen it is part of the single bin, hex, elf or dfu file. You can use dfu over serial with the built in bootloader or SWD witb STLINK to program the flash and it should run. If you want to usd the filesystem as well you can setup one unit, then suck a flash image out and us...
by Duramaximizer
Wed Apr 15, 2020 1:02 pm
Forum: General Discussion and Questions
Topic: Production Code for Custom Board
Replies: 9
Views: 1131

Production Code for Custom Board

Hello all, I've made myself a custom board and it is running the STM port of Micropython. I've used the REPL on a USB connector to get everything working, debugged and tested. The USB REPL is very handy for this. I've written my code in a class in a python file which I import. First I had this file ...
by Duramaximizer
Wed Apr 01, 2020 1:33 pm
Forum: MicroPython pyboard
Topic: Pin IRQ Debounce Messing with REPL
Replies: 10
Views: 912

Re: Pin IRQ Debounce Messing with REPL

Finally got it working! Made a new debounce routine using a timer, thank you for the suggestion jimmo! I needed to wait for the user to press and release the button as I was getting bounce after the release also. After the debounce is handled it calls my function to put the board to sleep, first ena...
by Duramaximizer
Fri Mar 27, 2020 7:13 pm
Forum: MicroPython pyboard
Topic: Pin IRQ Debounce Messing with REPL
Replies: 10
Views: 912

Re: Pin IRQ Debounce Messing with REPL

Thanks for the replies. Unfortunately I don't have access to uasyncio on this board at the moment and would need my linux box to get it on. I tried jimmo's code. The debounce works flawlessly however when I use it for my callback I'm running into issues. I'm starting to think there's a problem with ...
by Duramaximizer
Fri Mar 27, 2020 12:19 am
Forum: MicroPython pyboard
Topic: Pin IRQ Debounce Messing with REPL
Replies: 10
Views: 912

Re: Pin IRQ Debounce Messing with REPL

Make a 1 ms timer and the callback will check the button value and add 1 to a global counter. Where do I run this timer? In the Pin interrupt routine? No, in a new interrupt routine driven by a timer. On Pyboard you can use machine.Timer(-1) to easily create a "soft" timer. You don't need a pin int...
by Duramaximizer
Thu Mar 26, 2020 1:38 pm
Forum: MicroPython pyboard
Topic: Pin IRQ Debounce Messing with REPL
Replies: 10
Views: 912

Re: Pin IRQ Debounce Messing with REPL

Thank you! I should be able to make that work like my debounce routine. Just need to adapt it to check for a series of 1's and then a release for a series of 0's before exiting. Make a 1 ms timer and the callback will check the button value and add 1 to a global counter. Where do I run this timer? I...