Search found 7 matches

by jgpeiro
Tue May 24, 2022 6:35 pm
Forum: General Discussion and Questions
Topic: C++ module New/Delete and math and C libraries
Replies: 1
Views: 1090

C++ module New/Delete and math and C libraries

I have a C++ code that I can compile as Cpp module following the upy 1.18 documentation, but Im not sure how to "link" New and Delete operators with micropython garbage collector. Im wondering if this is the correct way: void *operator new(size_t size) { return gc_alloc(size, 0); } void *operator ne...
by jgpeiro
Sun Jun 13, 2021 7:24 am
Forum: Raspberry Pi microcontroller boards
Topic: Simulate PIOASM with pioemu
Replies: 0
Views: 1217

Simulate PIOASM with pioemu

Recently I found pioemu python package to simulate basic PIO programs on PC. The new trick here is that you can add the rp2 code to assemble programs directly on your PC too:

Image
by jgpeiro
Sun Jun 13, 2021 7:16 am
Forum: Raspberry Pi microcontroller boards
Topic: Add if/for/while to PIO asm
Replies: 4
Views: 2143

Add if/for/while to PIO asm

Im wondering if rp2.PIOASMEmit can be modified to handle simple C statements to use under @asm_pio as @asm_pio( set_init=rp2.PIO.OUT_LOW ) def prog(): if_( x ) set( pins, 1 ) else_() set( pins, 0 ) endif_() To do this, you need to add such funcions in PIOASMEmit and handle during different passes. d...
by jgpeiro
Fri Apr 30, 2021 8:32 am
Forum: General Discussion and Questions
Topic: mboot with FS placed on external SPI flash
Replies: 0
Views: 1598

mboot with FS placed on external SPI flash

I have an F745 based board that runs code from the MCU's internal flash memory and uses an external SPI flash memory for File System storage. Now I want to remotely update the board by storing the compressed dfu file in the FS (on the external SPI flash) and then calling mboot to do the upgrade, but...
by jgpeiro
Tue Mar 23, 2021 10:04 am
Forum: Development of MicroPython
Topic: sys.settrace and perfetto tool
Replies: 0
Views: 1986

sys.settrace and perfetto tool

Recently I discover sys.settreace functionality and it is really amazing. I also using an android trace visualization https://ui.perfetto.dev/#!/ that takes a json data like {"name":foo, "time start":0.1, "duration":0.4} and generates a cool interactive visualizations. It is easy generate such data ...
by jgpeiro
Sat Dec 21, 2019 7:47 pm
Forum: General Discussion and Questions
Topic: upy C module generator
Replies: 3
Views: 3079

upy C module generator

After some work I here is an experimental upy C module generator, useful for beginners who want compile new modules in C. This generator takes a python api interface as an input and generates complete C template that can be compiled with the kernel. The input can be any python function or class defi...
by jgpeiro
Wed Aug 05, 2015 8:37 am
Forum: General Discussion and Questions
Topic: CAN filters bug?
Replies: 2
Views: 3551

CAN filters bug?

I am not sure if it is a bug, but I cant configure the CAN filters properly. In this example, the expected result is only receive the "ok" messages, but some "fail" messages are received also... import pyb import time can = pyb.CAN( 1, pyb.CAN.LOOPBACK ) can.init( pyb.CAN.LOOPBACK, extframe=True ) f...