firmware issueshttps://git.flow3r.garden/card10/firmware/-/issues2019-11-13T11:28:54Zhttps://git.flow3r.garden/card10/firmware/-/issues/191Recheck integrity of systick_get_us()2019-11-13T11:28:54Zrahixcard10@rahix.deRecheck integrity of systick_get_us()The following discussion from !324 should be addressed:
- [ ] @schneider started a [discussion](https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/324#note_6631): (+2 comments)
> Do you know how long this keeps ...The following discussion from !324 should be addressed:
- [ ] @schneider started a [discussion](https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/324#note_6631): (+2 comments)
> Do you know how long this keeps interrupts disabled?
The function might behave incorrectly if an overflow happens just at the wrong time. Recheck whether this is the case (might be solvable by simply reordering the volatile reads).rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/issues/1901.12 USB Storage mode does not enumerate more than once before restart2019-12-26T12:10:10ZStormwind1.12 USB Storage mode does not enumerate more than once before restart1.12
Linux Mint 18.3 (based on Ubuntu 16.04)
Enter bootloader or USB storage mode app
eject or unplug card10
reconnect card10 via USB-C cable
>>>
[27745.936081] usb 6-2: new full-speed USB device number 112 using uhci_hcd
[27746.356...1.12
Linux Mint 18.3 (based on Ubuntu 16.04)
Enter bootloader or USB storage mode app
eject or unplug card10
reconnect card10 via USB-C cable
>>>
[27745.936081] usb 6-2: new full-speed USB device number 112 using uhci_hcd
[27746.356073] usb 6-2: device not accepting address 112, error -71
[27746.356134] usb usb6-port2: unable to enumerate USB device
>>>
works only after the next power cyclehttps://git.flow3r.garden/card10/firmware/-/issues/185Implement client API for BLE2019-11-08T11:27:04ZcoonImplement client API for BLEAt this point the card10 can only act as a BLE server but not as a BLE client. There should be a BLE API which can be used in l0dables and micropython m0dules for establishing a BLE connection and exchange data.At this point the card10 can only act as a BLE server but not as a BLE client. There should be a BLE API which can be used in l0dables and micropython m0dules for establishing a BLE connection and exchange data.cooncoonhttps://git.flow3r.garden/card10/firmware/-/issues/183GPIO Interrupts2019-10-18T07:05:02Zrahixcard10@rahix.deGPIO InterruptsAs per request in IRC, we might want an interface for GPIO interrupts.
To implement GPIO interrupts, a number of things are needed:
- A new API-call in [`epicardium.h`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master...As per request in IRC, we might want an interface for GPIO interrupts.
To implement GPIO interrupts, a number of things are needed:
- A new API-call in [`epicardium.h`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/epicardium/epicardium.h) to enable/disable interrupts for a specific GPIO + set whether it triggers on rising or on falling (Read the [API Guide](https://firmware.card10.badge.events.ccc.de/epicardium-guide.html) for more info). Take a look at the existing GPIO API ([Docs](https://firmware.card10.badge.events.ccc.de/epicardium/api.html#wristband-gpio) & [Code](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/epicardium/modules/gpio.c)) and make it compatible with that.
- Additionally, a new interrupt needs to be defined in [`epicardium.h:202`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/epicardium/epicardium.h#L202). Here we have to make a decision: One catch-all interrupt or separate interrupts for each GPIO pin? Read the [Interrupts](https://firmware.card10.badge.events.ccc.de/epicardium/api.html#interrupts) documentation for a bit more insight into how they work. I know, this part of the docs is a bit lacking ...
- The implementation of this API-call should setup the interrupt similar to [this code for example](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/epicardium/modules/bhi.c#L451-460).
- The interrupt handler defined for the previous point can't directly trigger the API interrupt. Instead, it needs to enqueue a job into FreeRTOS using [`xTimerPendFunctionCallFromISR()`](https://www.freertos.org/xTimerPendFunctionCallFromISR.html).
- This job can then call [`api_interrupt_trigger()`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/epicardium/api/interrupt-sender.c#L7) to trigger an interrupt in MicroPython.
- On the MicroPython side, we have a very minimal (sadly undocumented as of now!) module to install handlers for interrupts. For all new interrupt IDs defined in `epicardium.h`, an entry needs to be added in [`pycardium/modules/interrupt.c`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/pycardium/modules/interrupt.c#L85).
- You also need to add a wrapper for you new API call in [`pycardium/modules/gpio.c`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/pycardium/modules/gpio.c) and document it in [`Documentation/pycardium/gpio.rst`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/Documentation/pycardium/gpio.rst).
After doing all that, the following code should be able to catch an interrupt (With the small caveat that MicroPython needs to be busy-spinning for the handler to be executed for now ... See !324):
```python
import interrupt
def handler(x):
print("Got interrupt!")
# Call the new API-call to enable the GPIO interrupt here
...
interrupt.set_callback(interrupt.GPIO_INTERRUPT, handler)
interrupt.enable_callback(interrupt.GPIO_INTERRUPT)
while True:
pass
```
Hope this is enough to get someone started on implementing GPIO interrupts. If you have any questions, feel free to ping me here or in IRC!https://git.flow3r.garden/card10/firmware/-/issues/180Add timeout to I2C_MasterRead2019-10-04T15:15:11ZschneiderAdd timeout to I2C_MasterReadI've seen this function to hang indefinitely far to often already. As it is usually inside a lock, it can can make the whole device unresponsive.I've seen this function to hang indefinitely far to often already. As it is usually inside a lock, it can can make the whole device unresponsive.https://git.flow3r.garden/card10/firmware/-/issues/178Home menu improvement suggestions2019-11-10T22:42:03ZNiklas RoyHome menu improvement suggestions1) Menu Scrolling / first line
When scrolling in the home menu, there pops up a black rectangle on top of the screen, each time the left or right button is pushed. This happens when the first line is not shown in its entire height due ...1) Menu Scrolling / first line
When scrolling in the home menu, there pops up a black rectangle on top of the screen, each time the left or right button is pushed. This happens when the first line is not shown in its entire height due to the fine scrolling. That is irritating, as it makes it harder to see at a glance whether the menu is scrolling up or down.
2) General design clean up
The menu lines have currently two different background colors (light & dark blue). This could be reduced to one background color (e.g. light blue) and the other color (e.g. dark blue) could be used to indicate which line is currently selected. This would make the yellow '>' on the left side obsolete - and there could be displayed one character more in each line. That would be helpful, as the display is anyway very small and space should be used carefully. It would be also nice to be able to configure the colors and the menu font externally.
3) Button order
The menu moves up and down while the buttons to move the menu are left and right, which is not logical. IMHO it would make far more sense to use the two buttons on the right side for moving the menu up and down and to use the lower button on the left side to select a menu item. TL;DR: Swap 'Select' button with 'Left' button.https://git.flow3r.garden/card10/firmware/-/issues/176feature request: Let LEDs blink for a certain time2019-10-04T12:32:22Zzenoxfeature request: Let LEDs blink for a certain timeSimilar to the vibra.vibrate(millis) function I would like to have a function that lets a LED blink for a certain time without blocking the python part of the card10. I think this is useful as an indicator.
For a start it might be enoug...Similar to the vibra.vibrate(millis) function I would like to have a function that lets a LED blink for a certain time without blocking the python part of the card10. I think this is useful as an indicator.
For a start it might be enough to do this for the rockets.
I would like to try the implementation myself as it seems simple enough to mimic the functionality of the vibra.vibrate() function. My suggestion for the interface would be:
leds.blink_rocket(led, value, millis)
Any concerns/opinions/hints about this?!
cheers! zenoxhttps://git.flow3r.garden/card10/firmware/-/issues/175Serial: Concurrent Input/Output can lead to a lock2019-10-18T14:43:47ZschneiderSerial: Concurrent Input/Output can lead to a lockWhen pasting large amounts of data into the Python interpreter, the serial task is used to pipe data into the interpreter as well as writing its output to the serial line. If the input buffer towards the interpreter is full the task wait...When pasting large amounts of data into the Python interpreter, the serial task is used to pipe data into the interpreter as well as writing its output to the serial line. If the input buffer towards the interpreter is full the task waits for some time to wait for it to clear and then tries to insert the rest of the data.
At the same time the interpreter can be blocked because it tries to output data to the serial console, but can't because the serial task is not reading from its output queue (because it is waiting to send more data to the interpreter...)v1.13https://git.flow3r.garden/card10/firmware/-/issues/174TMR5 not usable for IR PWM (IRQ already in use for epicardium API) ?2021-11-16T22:40:25ZFrançois RevolTMR5 not usable for IR PWM (IRQ already in use for epicardium API) ?In my quest to implement TV-B-GONE on the IR LED, I noticed the TMR5 that's wired to the I/O pin P0.23 is already used for the epicardium API, at least its IRQ.
For now I switched to TMR3 in my patches, but I'm not sure which timer is b...In my quest to implement TV-B-GONE on the IR LED, I noticed the TMR5 that's wired to the I/O pin P0.23 is already used for the epicardium API, at least its IRQ.
For now I switched to TMR3 in my patches, but I'm not sure which timer is best to use for the API (or maybe we could still use TMR5 regardless for PWM as long as we don't set it to generate an IRQ? Probably not since it's triggered by setting the timer to 1us).v1.19rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/issues/173Regression with font rendering in 1.11.2019-10-09T16:59:45ZbaldoRegression with font rendering in 1.11.With the new 1.11 firmware texts are now hard to read. The rendering somehow seems off.
![font-rendering](/uploads/a5fb67404beed80dd52a6ebbaebfcf60/font-rendering.jpg)
There are some characters that especially hard to read:
* "a" some...With the new 1.11 firmware texts are now hard to read. The rendering somehow seems off.
![font-rendering](/uploads/a5fb67404beed80dd52a6ebbaebfcf60/font-rendering.jpg)
There are some characters that especially hard to read:
* "a" sometimes looks like "o"
* "l" and "i" are hard to tell apart.
Also the font sizes seem to have changed somewhat, which leads to unexpected line breaks in different apps, e.g.:
* battery_info: Units are now sometimes rendered in a new line, which renders values unreadable.
* Sleeptracker: The lines "touch" each other vertically and the timer in the bottom left is unreadable.
Also it looks a little bit as if a font with proportional letter widths is used as a monotype font.https://git.flow3r.garden/card10/firmware/-/issues/170Add "display-off" mode to ECG App2019-11-22T21:28:08Zrahixcard10@rahix.deAdd "display-off" mode to ECG AppIt would be cool if the ECG app had a mode where the display and LEDs are turned off to do long (passive) measurements.
The following discussion from !296 should be addressed:
- [ ] @griffon started a [discussion](https://git.card10.ba...It would be cool if the ECG app had a mode where the display and LEDs are turned off to do long (passive) measurements.
The following discussion from !296 should be addressed:
- [ ] @griffon started a [discussion](https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/296#note_5670): (+1 comment)
> In theory we could add more modes. Like display backlight off for power safe during logging. But in theorey i would prefer to have powersafe features in epicardium rather then the app.https://git.flow3r.garden/card10/firmware/-/issues/169Switch sensor-streams to use Stream Buffers2019-09-22T09:11:42Zrahixcard10@rahix.deSwitch sensor-streams to use Stream BuffersThe current sensor-stream implementation has quite a few issues. It should be refactored to use [Stream Buffers](https://www.freertos.org/RTOS-stream-buffer-example.html) instead of the current queue-based implementation. There should ...The current sensor-stream implementation has quite a few issues. It should be refactored to use [Stream Buffers](https://www.freertos.org/RTOS-stream-buffer-example.html) instead of the current queue-based implementation. There should also be an overflow behavior where the oldest values are discarded.
In the process of refactoring, the queue-writing (and creation) should be changed to no longer use the FreeRTOS API directly, but instead happen via some functions defines as part of the stream module. This way, future changes will be much easier.
The following discussion from !316 should be addressed:
- [ ] @rahix started a [discussion](https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/316#note_6011): (+6 comments)
> The MR is ready to be merged, but I will hold off until the I2C race which is triggered by this is fixed (the upstream version also triggers it, but not as quickly).
cc @flo_hhttps://git.flow3r.garden/card10/firmware/-/issues/168Text is now rendered with a transparent background but some apps still assume...2019-09-24T19:00:29ZFlorianText is now rendered with a transparent background but some apps still assume it is opaqueChanging the default background to transparent did at least mess up the display of the BHI160 app.Changing the default background to transparent did at least mess up the display of the BHI160 app.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/issues/161Pressing menu button often and quickly can lead to `api-dispatcher: API funct...2020-10-05T20:19:50ZschneiderPressing menu button often and quickly can lead to `api-dispatcher: API function 0x0 is unknown!!`Log:
```
[ 45159] lifecycle: Loading "menu.py" ...
--------------------------------
Pycardium
Version: v1.10-4-gf1818479-dirty
--------------------------------
Loading menu.py ...
[ 45380] lifecycle: Loading "me...Log:
```
[ 45159] lifecycle: Loading "menu.py" ...
--------------------------------
Pycardium
Version: v1.10-4-gf1818479-dirty
--------------------------------
Loading menu.py ...
[ 45380] lifecycle: Loading "menu.py" ...
--------------------------------
Pycardium
Version: v1.10-4-gf1818479-dirty
--------------------------------
Loading menu.py ...
[ 45634] lifecycle: Loading "menu.py" ...
[ 45640] api-dispatcher: API function 0x0 is unknown!!
--------------------------------
Pycardium
Version: v1.10-4-gf1818479-dirty
--------------------------------
Loading menu.py ...
[ 45860] lifecycle: Loading "menu.py" ...
--------------------------------
Pycardium
Version: v1.10-4-gf1818479-dirty
--------------------------------
Loading menu.py ...
```rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/issues/160API Interrupt Deadlocking2020-10-05T19:31:37Zrahixcard10@rahix.deAPI Interrupt DeadlockingWhen the core 1 payload becomes unresponsive to interrupts, Epicardium busy-spins in [`epicardium/api/interrupt-sender.c:14`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/epicardium/api/interrupt-sender.c#L14). Thi...When the core 1 payload becomes unresponsive to interrupts, Epicardium busy-spins in [`epicardium/api/interrupt-sender.c:14`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/epicardium/api/interrupt-sender.c#L14). This will drown out the idle-task and thus prevents any further API calls.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/issues/159Add bluetooth connectivity status2019-09-14T09:42:21Zchristian-draegerAdd bluetooth connectivity statusIt seems like there is no possibility to get the bluetooth connectivity status via python on the card10 (or at least it's not documented). Could this be added by any chance? It seems like there is no possibility to get the bluetooth connectivity status via python on the card10 (or at least it's not documented). Could this be added by any chance? https://git.flow3r.garden/card10/firmware/-/issues/152Add triangle drawing to display API2019-09-14T18:16:48ZxiretzaAdd triangle drawing to display APITriangles make it a lot easier to draw arbitrary shapes. Non-filled triangles are easy (just three lines), filled triangles require some form of rasterization - since most of the logic required for that is already used in line drawing, i...Triangles make it a lot easier to draw arbitrary shapes. Non-filled triangles are easy (just three lines), filled triangles require some form of rasterization - since most of the logic required for that is already used in line drawing, it might make sense to generalize that algorithm somehow.https://git.flow3r.garden/card10/firmware/-/issues/149Serial device (ttyACM0) keeps reconnecting since v1.72019-09-07T18:36:12ZPetePrioritySerial device (ttyACM0) keeps reconnecting since v1.7I can't get my serial device to work since v1.7. I'm running
```
$ uname -a
Linux 5.2.11-arch1-1-ARCH #1 SMP PREEMPT Thu Aug 29 08:09:36 UTC 2019 x86_64 GNU/Linux
```
I've attached an excerpt of `dmesg`'s output after plugging in the r...I can't get my serial device to work since v1.7. I'm running
```
$ uname -a
Linux 5.2.11-arch1-1-ARCH #1 SMP PREEMPT Thu Aug 29 08:09:36 UTC 2019 x86_64 GNU/Linux
```
I've attached an excerpt of `dmesg`'s output after plugging in the running card10 at the bottom of this issue.
The ttyACM device gets an immediate disconnect after being loaded, sometimes with a
```
[ 3669.174629] usb 9-5: can't set config #1, error -62
```
or
```
[ 3667.922690] usb 9-5: unable to read config index 0 descriptor/all
[ 3667.922697] usb 9-5: can't read configurations, error -62
```
error message sprinkled in.
Attaching the card10 in bootloader mode works fine. The problem does not exist with firmware version v1.6. The difference from the `dmesg` logs seems to be the Product string:
`Product: MAX32665 CDC-ACM` (v1.6)
vs
`Product: CARD10 USB GADGET` (>=v1.7)
dmesg excerpt:
```
[ 3666.447041] usb 9-5: new full-speed USB device number 38 using ohci-pci
[ 3666.632687] usb 9-5: New USB device found, idVendor=0b6a, idProduct=003c, bcdDevice= 1.00
[ 3666.632694] usb 9-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3666.632697] usb 9-5: Product: CARD10 USB GADGET
[ 3666.632701] usb 9-5: Manufacturer: Maxim Integrated
[ 3666.634846] cdc_acm 9-5:1.0: ttyACM0: USB ACM device
[ 3666.687008] usb 9-5: USB disconnect, device number 38
[ 3667.103720] usb 9-5: new full-speed USB device number 39 using ohci-pci
[ 3667.287680] usb 9-5: New USB device found, idVendor=0b6a, idProduct=003c, bcdDevice= 1.00
[ 3667.287687] usb 9-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3667.287691] usb 9-5: Product: CARD10 USB GADGET
[ 3667.287694] usb 9-5: Manufacturer: Maxim Integrated
[ 3667.289829] cdc_acm 9-5:1.0: ttyACM0: USB ACM device
[ 3667.453801] usb 9-5: USB disconnect, device number 39
[ 3667.740373] usb 9-5: new full-speed USB device number 40 using ohci-pci
[ 3667.922690] usb 9-5: unable to read config index 0 descriptor/all
[ 3667.922697] usb 9-5: can't read configurations, error -62
[ 3668.350392] usb 9-5: new full-speed USB device number 41 using ohci-pci
[ 3668.534692] usb 9-5: New USB device found, idVendor=0b6a, idProduct=003c, bcdDevice= 1.00
[ 3668.534699] usb 9-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3668.534703] usb 9-5: Product: CARD10 USB GADGET
[ 3668.534706] usb 9-5: Manufacturer: Maxim Integrated
[ 3668.536864] cdc_acm 9-5:1.0: ttyACM0: USB ACM device
[ 3668.707161] usb 9-5: USB disconnect, device number 41
[ 3668.990387] usb 9-5: new full-speed USB device number 42 using ohci-pci
[ 3669.172693] usb 9-5: string descriptor 0 read error: -62
[ 3669.172702] usb 9-5: New USB device found, idVendor=0b6a, idProduct=003c, bcdDevice= 1.00
[ 3669.172707] usb 9-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3669.174629] usb 9-5: can't set config #1, error -62
[ 3669.174828] usb 9-5: USB disconnect, device number 42
[ 3669.600417] usb 9-5: new full-speed USB device number 43 using ohci-pci
[ 3673.950436] usb 9-5: new full-speed USB device number 44 using ohci-pci
[ 3674.139753] usb 9-5: New USB device found, idVendor=0b6a, idProduct=003c, bcdDevice= 1.00
[ 3674.139759] usb 9-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3674.139763] usb 9-5: Product: CARD10 USB GADGET
[ 3674.139766] usb 9-5: Manufacturer: Maxim Integrated
[ 3674.141911] cdc_acm 9-5:1.0: ttyACM0: USB ACM device
[ 3674.183882] usb 9-5: USB disconnect, device number 44
```swymswymhttps://git.flow3r.garden/card10/firmware/-/issues/147utime functions don't allow None as argument2019-09-24T20:17:08Zrahixcard10@rahix.deutime functions don't allow None as argument`utime.localtime` and `utime.alarm` should also allow `None` as arguments, eg:
```python
utime.localtime(None)
# should be the same as
utime.localtime()
````utime.localtime` and `utime.alarm` should also allow `None` as arguments, eg:
```python
utime.localtime(None)
# should be the same as
utime.localtime()
```https://git.flow3r.garden/card10/firmware/-/issues/145BLE Management Interface2019-08-30T08:36:40Zrahixcard10@rahix.deBLE Management InterfaceFrom the discussion:
"Management Interface"
======================
- Copy BLE UART
- Commands:
- Query App-List
- Request start of new app
- App Version Info
Starting apps from the companion app
----------------------------------...From the discussion:
"Management Interface"
======================
- Copy BLE UART
- Commands:
- Query App-List
- Request start of new app
- App Version Info
Starting apps from the companion app
------------------------------------
- epic_exec("file.py")
App Updates
-----------
- using management interface for querying info