firmware issueshttps://git.flow3r.garden/card10/firmware/-/issues2019-08-16T22:36:32Zhttps://git.flow3r.garden/card10/firmware/-/issues/1Card10 App-Ideen2019-08-16T22:36:32ZbitnapperCard10 App-IdeenVorab: Entschuldigung falls der App-Vorschlag an der falschen Stelle gelandet ist. Auf dem EasterEgg wurde um Ideen für Apps gebeten aber ich habe keinen besseren Ort gefunden um diese zu droppen.
# Send-me-an-Angel
Eine App mit der Sh...Vorab: Entschuldigung falls der App-Vorschlag an der falschen Stelle gelandet ist. Auf dem EasterEgg wurde um Ideen für Apps gebeten aber ich habe keinen besseren Ort gefunden um diese zu droppen.
# Send-me-an-Angel
Eine App mit der Shiftcoordinatoren des Heavens über die Card10 nach Engel für spezielle Aufgaben suchen können, für die spezielle Fähigkeiten erforderlich sind.
Engel müssen sich im Engelsystem registrieren und können Fähigkeiten die sie besitzen aus einer definierten und erweiterbaren Liste (z.B. kann BGP, kann IPv6 Routing (linux), hat Schweißgerät) auswählen.
Shiftcoordinatoren können bei Bedarf eine Anfrage nach einem Engel mit einer bestimmten Fähigkeit senden. Diese verteilt sich über die Card10s und löst bei allen Engeln mit einer entsprechenden Fähigkeit einen Notifiaction aus. Diese können dann die Anfrage annehmen oder ablehnen (bzw. ignorieren).
Der Nachricht müssten standardisierte Daten wie Ort und Zeit mitgegeben werden sowie eine Beschreibung des Tasks.
# Skillshare
Typ: social
Ähnlich wie Send-me-an-Angel können alle Teilnehmenden Skills eintragen. Zu jedem Skill kann angegeben werden, ob man diesen bereitstellen kann oder ob man diesen gerne erlangen will. Sehen sich zwei Card10 mit einem passenden Skillset (A sucht Skill B, C bietet Skill B), werden beide informiert.
# Toolshare
Wie Skillshare, nur mit Werkzeugen (Biete Trockeneis trifft Suche Trockeneis > Bing!).https://git.flow3r.garden/card10/firmware/-/issues/7BLE mesh capability2019-10-04T12:03:39Zch3BLE mesh capabilityGet the bluetooth LE module to form meshes with other card10s.Get the bluetooth LE module to form meshes with other card10s.https://git.flow3r.garden/card10/firmware/-/issues/12STREX/LDREX instead of Semaphore2019-07-07T11:54:57Zrahixcard10@rahix.deSTREX/LDREX instead of Semaphore- Replace current semaphore API implementation with one based on STREX/LDREX.
- http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dht0008a/ch01s02s01.html
- Measure performance- Replace current semaphore API implementation with one based on STREX/LDREX.
- http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dht0008a/ch01s02s01.html
- Measure performancehttps://git.flow3r.garden/card10/firmware/-/issues/18Improve BMA400 module2019-09-14T18:06:26Zrahixcard10@rahix.deImprove BMA400 moduleThere is a barebones BMA400 module available in the `rahix/bma400` branch. This module needs to be extended to contain more of the functionality of the chip.
It also has a bug which is the first reading returning an error as the chip i...There is a barebones BMA400 module available in the `rahix/bma400` branch. This module needs to be extended to contain more of the functionality of the chip.
It also has a bug which is the first reading returning an error as the chip isn't yet initialized (it takes some time to do so).https://git.flow3r.garden/card10/firmware/-/issues/19MTP Implementation2019-08-18T12:29:23Zrahixcard10@rahix.deMTP ImplementationRight now, the only way to access the external flash from the host is using the bootloader. Epicardium should, additionally to the CDC ACM, export an MTP device to allow editing files.
It has to be MTP and can't be a simple block stora...Right now, the only way to access the external flash from the host is using the bootloader. Epicardium should, additionally to the CDC ACM, export an MTP device to allow editing files.
It has to be MTP and can't be a simple block storage, because otherwise we cannot synchronize file accesses from the outside and from the inside.https://git.flow3r.garden/card10/firmware/-/issues/28ECG Tracking Issue2019-09-15T12:18:26Zch3ECG Tracking IssueThis issue is supposed to be a general tracker for all things ECG related until a more specific design has been decided upon.This issue is supposed to be a general tracker for all things ECG related until a more specific design has been decided upon.https://git.flow3r.garden/card10/firmware/-/issues/29UI/UX Tracking Issue2019-08-18T20:24:40Zrahixcard10@rahix.deUI/UX Tracking IssueWe need to define the user-interface card10 provides. Please comment your ideas!We need to define the user-interface card10 provides. Please comment your ideas!https://git.flow3r.garden/card10/firmware/-/issues/32Shitty Addon Module2019-07-11T10:59:06Zrahixcard10@rahix.deShitty Addon ModuleA module to access the shitty addon connector. This requires adding the necessary calls to Epicardium API ([Guide](https://card10.badge.events.ccc.de/en/firmware/epicardium_api_development/)) and creating a c-module for Pycardium ([Guide...A module to access the shitty addon connector. This requires adding the necessary calls to Epicardium API ([Guide](https://card10.badge.events.ccc.de/en/firmware/epicardium_api_development/)) and creating a c-module for Pycardium ([Guide](https://card10.badge.events.ccc.de/en/firmware/pycardium_modules/)).
This includes:
- The i2c bus, ideally in a way that can be used by existing python driver libraries. (Ref [`lib/micropython/micropython/extmod/machine_i2c.c`](https://github.com/micropython/micropython/blob/master/extmod/machine_i2c.c))
- The two GPIOshttps://git.flow3r.garden/card10/firmware/-/issues/34Power Management2019-08-31T07:13:59Zrahixcard10@rahix.dePower ManagementTodo:
- [ ] `CNFG_CHG_{A,B,C,D,E,F,G}` Configuration in [`lib/card10/pmic.c`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/lib/card10/pmic.c)
- [ ] `CNFG_CHG_A`:
- Configure NTC Parameters
- THM_HOT[1:0]:...Todo:
- [ ] `CNFG_CHG_{A,B,C,D,E,F,G}` Configuration in [`lib/card10/pmic.c`](https://git.card10.badge.events.ccc.de/card10/firmware/blob/master/lib/card10/pmic.c)
- [ ] `CNFG_CHG_A`:
- Configure NTC Parameters
- THM_HOT[1:0]: 0x0 (45°C)
- THM_WARM[1:0]: 0x0 (35°C)
- THM_COOL[1:0]: 0x3 (15°C)
- THM_COLD[1:0]: 0x3 (5°C)
- [ ] `CNFG_CHG_B`:
- VCHGIN_MIN[2:0]: 0x0 (4.0V) //Minimum Charge-In: 4V
- ICHGIN_LIM[2:0]: 0x4 (475mA) //Charge Limit: 475mA
- I_PQ: 0x0 (10%)
- CHG_EN: 0x1 (At the very end: `CHG_EN` to 1 to enable the charger block)
- [ ] `CNFG_CHG_C`:
- CHG_PQ[1:0]: 0x7 (Prequalification Voltage: 3.0V)
- I_TERM[0:1]: 0x3 (Charger Termination Current: 15% (default))
- T_TOPPOFF[2:0]: 0x0 (Topoff Timer: 0min)
- [ ] `CNFG_CHG_D`:
- TJ_REG[2:0]: 0x0 (Junction Temp Regulation: 60°C)
- VSYS_REG[4:0]: 0x10 (4.5V)
- [ ] `CNFG_CHG_E`:
- CHG_CC[5:0]: 0x0b (90mA) //Constant Current
- T_FAST_CHG[1:0]: 0x1 (3h) //Fast Charge Saftey Timer: 3h (`0x01`)
- [ ] `CNFG_CHG_F`:
- CHG_CC_JEITA[5:0]: 0x07 (60mA) //reduce charger current when battery is warm or cool
- THM_EN: 0x1 //Thermistor Enable: on
- [ ] `CNFG_CHG_G`:
- CHG_CV[5:0]: 0x18 (4.2V) //Constant Charging Voltage
- USBS: 0x0 //`USBS` (USB Suspend): 0
- [ ] `CNFG_CHG_H`:
- CHG_CV_JEITA[5:0]: 0x10 (4.0V) //`CHG_CV_JEITA`: /
- [ ] `CNFG_CHG_I`:
- IMON_DISCHG_SCALE[3:0]: 0x0a (300mA)
- MUX_SEL[3:0]: 0x0 //`MUX_SEL` (ADC MUX): 0 by default, value for measurements
- [ ] House Keeping Tasks
- [ ] Battery Voltage (60s for now)
- Check how PMIC reacts to poweroffhttps://git.flow3r.garden/card10/firmware/-/issues/35Core 1 Event Mechanism2019-09-05T13:47:44Zrahixcard10@rahix.deCore 1 Event MechanismThere should be a way to get card10 into a low power sleep mode from (py)cardium. Coupled with this, there needs to be a way to wake core1 back up. This should be made into a general event handling mechanism that allows polling and blo...There should be a way to get card10 into a low power sleep mode from (py)cardium. Coupled with this, there needs to be a way to wake core1 back up. This should be made into a general event handling mechanism that allows polling and blocking on single or multiple event sources.
MicroPython already contains a `uselect` library that might play into this. We also already have an interrupt from epicardium to core1 using a timer. This is used for `^C` handling.
Event sources that should be supported:
- [x] Serial (UART, CDC ACM, Bluetooth)
- [ ] Push Buttons
- [ ] BMA400 Tap Detection
- [ ] BHI160 Activity Detection
- [ ] ECG? (waiting for #28)
- [ ] Bluetooth
- [ ] GPIOs (Wristband #31 & SA #32)schneiderschneiderhttps://git.flow3r.garden/card10/firmware/-/issues/43Epicardium Error Management2019-10-22T15:58:51Zrahixcard10@rahix.deEpicardium Error ManagementThere are a lot of sources for errors in Epicardium. Right now, most of them are handled by printing error messages, halting the respective task, or aborting everything. This is bad for a variety of reasons.
Instead, we need a central...There are a lot of sources for errors in Epicardium. Right now, most of them are handled by printing error messages, halting the respective task, or aborting everything. This is bad for a variety of reasons.
Instead, we need a central error management facility with the following features:
- Making the user aware of the error in a useful way. UART printfs are not enough as most people won't have a debugger connected anyway (Maybe displaying a warning symbol?)
- Dealing with errors of different severities in appropriate ways. This means providing ways to restart card10, or just certain subsystems (Especially looking at bluetooth here).
- Restarting the core 1 payloadhttps://git.flow3r.garden/card10/firmware/-/issues/46Activate threading in micropython2019-07-18T22:27:56Zch3Activate threading in micropythonhttps://git.flow3r.garden/card10/firmware/-/issues/47Port UART to stream interface2019-08-03T16:42:06Zch3Port UART to stream interfacehttps://git.flow3r.garden/card10/firmware/-/issues/48Document interrupt architecture2019-07-26T14:31:41Zch3Document interrupt architecturehttps://git.flow3r.garden/card10/firmware/-/issues/54CDC-ACM locks up when closing terminal on host2020-05-21T12:11:13Zrahixcard10@rahix.deCDC-ACM locks up when closing terminal on host#### Steps to reproduce:
1. Reset card10 (firmware @ 3ccec228b836db76c2fa42a0f3f1771779be59d7)
2. Open debugger terminal (`picocom -b 115200 /dev/ttyACM0`)
3. Open CDC-ACM terminal (`picocom -b 115200 /dev/ttyACM1`)
4. Close CDC-ACM ter...#### Steps to reproduce:
1. Reset card10 (firmware @ 3ccec228b836db76c2fa42a0f3f1771779be59d7)
2. Open debugger terminal (`picocom -b 115200 /dev/ttyACM0`)
3. Open CDC-ACM terminal (`picocom -b 115200 /dev/ttyACM1`)
4. Close CDC-ACM terminal (Press `^A^Q`)
5. Paste a long text into debugger terminal
#### Observation:
The debugger terminal becomes unresponsive. Under the hood, Epicardium is spinning in MAXUSB's `acm_write` because its internal FIFO-buffer (129 bytes) if full and not emptied by the host.https://git.flow3r.garden/card10/firmware/-/issues/55Add flush function to streams2019-07-22T15:43:52ZschneiderAdd flush function to streamsTo empty the queue and throw away old samplesTo empty the queue and throw away old sampleshttps://git.flow3r.garden/card10/firmware/-/issues/57BLE: Make use of privacy features2019-08-07T11:36:53ZschneiderBLE: Make use of privacy featuresCheck out `DmDevPrivInit()` and `DmDevPrivStart()` and in general `dm_dev_priv.c`. Some stack inits use it, some don't.Check out `DmDevPrivInit()` and `DmDevPrivStart()` and in general `dm_dev_priv.c`. Some stack inits use it, some don't.https://git.flow3r.garden/card10/firmware/-/issues/63Investigate display blanking issue2019-08-18T20:18:51ZschneiderInvestigate display blanking issueI've seen it multiple times that the display would simply go blank, not showing anything anymore. A reset resolves the issue.
I don't know what happens. There seems to be a dependency to the SPI frequency and also the particular card10.I've seen it multiple times that the display would simply go blank, not showing anything anymore. A reset resolves the issue.
I don't know what happens. There seems to be a dependency to the SPI frequency and also the particular card10.https://git.flow3r.garden/card10/firmware/-/issues/64BLE: What is ATTS_PERMIT_WRITE_AUTHORIZ?2019-09-01T20:51:23ZschneiderBLE: What is ATTS_PERMIT_WRITE_AUTHORIZ?The stack defines it, but never uses it.The stack defines it, but never uses it.https://git.flow3r.garden/card10/firmware/-/issues/66epicardium (&pycardium) USB API2019-08-20T07:41:56Zswymepicardium (&pycardium) USB APILooking at the way the device and interface descriptors are configured in cdcacm.c, bootloader-usb.c and basically every MAXUSB sdk example, there is ample room for generalization and actually, if we want to add/remove USB interfaces at ...Looking at the way the device and interface descriptors are configured in cdcacm.c, bootloader-usb.c and basically every MAXUSB sdk example, there is ample room for generalization and actually, if we want to add/remove USB interfaces at runtime, as is needed for USB mass storage, there is need for generalization.
Looking at it, I've been thinking about building the descriptors at runtime - malloc'ing the memory region with the (easily determined) size needed and filling several iFooBar references dynamically to point to the corresponding enum_register_descriptor indizes. This way we don't need to have several hard-coded descriptors on RAM when we don't need them and would also buy lots of flexibility that way.
Furthermore, at least for me, an obvious fun thing to do, when handed a programmable badge with USB, is to implement own devices, HID being a prime example.
How about:
- an API for building descriptors
- offering our default built-in interfaces cdcacm and mass storage
- but also, for user-defined interfaces, exposing the endpoints via our stream interface.
This way it would be possible to implement HID devices in python via streams and struct.pack (or whatever it's called)
Thoughts?swymswymhttps://git.flow3r.garden/card10/firmware/-/issues/75Add UI Lock2019-08-18T11:42:55Zrahixcard10@rahix.deAdd UI LockThe current display lock should be replaced by a general purpose UI lock which allows Epicardium to (temporarily) take over the display and input peripherals.
Related to #74.The current display lock should be replaced by a general purpose UI lock which allows Epicardium to (temporarily) take over the display and input peripherals.
Related to #74.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/issues/91Make personal-state animation a timer instead of a task2019-08-20T20:32:17Zrahixcard10@rahix.deMake personal-state animation a timer instead of a taskThe following discussion from !117 should be addressed:
- [ ] @rahix started a [discussion](https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/117#note_2729): (+4 comments)
> I think a timer would be more approp...The following discussion from !117 should be addressed:
- [ ] @rahix started a [discussion](https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/117#note_2729): (+4 comments)
> I think a timer would be more appropriate, but considering the timeframe we might want to refactor this at a later date ...https://git.flow3r.garden/card10/firmware/-/issues/92ble: card10 svc notify about sensor data2019-08-22T15:11:19Zgenofireble: card10 svc notify about sensor data- blocked by !51 and !85- blocked by !51 and !85https://git.flow3r.garden/card10/firmware/-/issues/95Display: Dim backlight based on light sensor2019-09-04T19:31:53ZschneiderDisplay: Dim backlight based on light sensorEspecially should become dimmer when it gets dark.
Not sure what the best value is when the day start is in "ON" mode.Especially should become dimmer when it gets dark.
Not sure what the best value is when the day start is in "ON" mode.https://git.flow3r.garden/card10/firmware/-/issues/100Expose I2C in MicroPython2019-08-22T11:00:24ZkoaloExpose I2C in MicroPythonFor accessing internal and external sensors directly from MicroPython, I2C shall be exposed via I2C.
In order to prevent bricking the card10, chips such as the PMIC have to be blacklisted.For accessing internal and external sensors directly from MicroPython, I2C shall be exposed via I2C.
In order to prevent bricking the card10, chips such as the PMIC have to be blacklisted.swymswymhttps://git.flow3r.garden/card10/firmware/-/issues/101Python can block the light sensor2020-10-05T20:19:53ZschneiderPython can block the light sensorA code like this:
```Python
import os
while True: print(os.read_battery())
```
Leads to a log like this:
```
4.15646
4.15646
4.15646
4.15646
4.15646
4.152076
4.15646
4.152076
4.15646
4.15646
4.15646
[ 419615] hwlock: Lock 1 is busy...A code like this:
```Python
import os
while True: print(os.read_battery())
```
Leads to a log like this:
```
4.15646
4.15646
4.15646
4.15646
4.15646
4.152076
4.15646
4.152076
4.15646
4.15646
4.15646
[ 419615] hwlock: Lock 1 is busy.
4.15646
4.15646
4.15646
4.15646
4.15646
4.15646
4.15646
4.15646
4.152076
4.15646
4.15646
4.15646
4.15646
4.15646
4.15646
4.15646
[ 419715] hwlock: Lock 1 is busy.
4.15646
4.15646
4.15646
4.15646
4.15646
4.15646
4.152076
4.15646
4.15646
4.15646
4.15646
4.15646
```
Code is like this:
```
static void readAdcCallback()
{
if (hwlock_acquire(HWLOCK_ADC, 0) != 0) {
/* Can't do much about this here ... Retry next time */
return;
}
ADC_StartConvert(ADC_CH_7, 0, 0);
ADC_GetData(&last_value);
hwlock_release(HWLOCK_ADC);
}
```
I guess we should give the lock a bit of time to acquire.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/issues/105Expose hardware specific details as a single epic request, and propogate up t...2019-08-22T10:25:41ZDanukeru (Paul)Expose hardware specific details as a single epic request, and propogate up to python.We would like to get details such as the current MAC address and other hardware IDs exposed to the developer.We would like to get details such as the current MAC address and other hardware IDs exposed to the developer.https://git.flow3r.garden/card10/firmware/-/issues/113add non ascii characters to font(s)2019-09-05T06:47:43ZJonas Grosse-Holzadd non ascii characters to font(s)https://git.flow3r.garden/card10/firmware/-/issues/123Expose battery status in BLE as Battery Service2019-08-30T15:07:31ZPatrickExpose battery status in BLE as Battery Servicehttps://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org.bluetooth.service.battery_service.xmlhttps://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org.bluetooth.service.battery_service.xmlhttps://git.flow3r.garden/card10/firmware/-/issues/131(feat) Create an OS overlay screen2019-10-06T12:00:20ZStefan Haun(feat) Create an OS overlay screenWe (@klausdieter1 and @penguineer) are working on an overlay framebuffer that can be used by the epicardium processes to write information on the display.
The API will be unchanged except for:
* add a function to select the overlay FB ...We (@klausdieter1 and @penguineer) are working on an overlay framebuffer that can be used by the epicardium processes to write information on the display.
The API will be unchanged except for:
* add a function to select the overlay FB after opening the display
* add a function to disable the the overlay FB (for fullscreen apps)
* add a function to get the overlay visibility (background process can pause when overlay is not visible)
We will create a second framebuffer for the overlay. The color 0x0000 will be interpreted as transparent.
epic_disp_update will compose the app and the os framebuffer for the display.
Apps will not see any difference, except that there are more information on the screen.https://git.flow3r.garden/card10/firmware/-/issues/133Accelerometer and Gyroscope axes don't match up2020-01-02T09:05:55ZxiretzaAccelerometer and Gyroscope axes don't match upIt seems like the translation matrices for the BHI160 aren't completely consistent. Using the "BHI160" app to read the sensor data, it looks like the accelerometer is a left-handed coordinate system. If the badge is lying flat on a table...It seems like the translation matrices for the BHI160 aren't completely consistent. Using the "BHI160" app to read the sensor data, it looks like the accelerometer is a left-handed coordinate system. If the badge is lying flat on a table:
- X points right
- Y points forward
- Z points down (into the table)
However the gyro axes aren't the same (if we assume positive values being clockwise rotation around the directional vector):
- X points right
- Y points forward
- Z points up
As can be seen, the Z axis is inverted. This means that while downward acceleration (like gravity) causes positive accel values, clockwise rotation around the vertical axis causes negative gyro values.
To try to fix this, I changed the translation matrix in [bhi.c](epicardium/modules/bhi.c#L32) to invert the Z axis:
```diff
-static int8_t bhi160_mapping_matrix[3 * 3] = { 0, -1, 0, 1, 0, 0, 0, 0, 1 };
+static int8_t bhi160_mapping_matrix[3 * 3] = { 0, -1, 0, 1, 0, 0, 0, 0, -1 };
```
This does indeed fix the gyro axis! Gyro Z now points down, with clockwise rotation causing positive values. This matrix is used for both the gyro and the accelerometer though, so the accelerometer should have been inverted too - which doesn't happen. In fact the accelerometer seems to be completely immune to this matrix, which may be a separate issue.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/issues/137BLE: expose the sensor results2019-08-30T08:39:15ZSuperwallahBLE: expose the sensor resultsSo far, only the LEDs, mood state and vibrator can be remotely controlled and the light sensor can be checked.
I would like to use the card10 by a more powerful controller (like a mobile) and use it only as a sensor data source.So far, only the LEDs, mood state and vibrator can be remotely controlled and the light sensor can be checked.
I would like to use the card10 by a more powerful controller (like a mobile) and use it only as a sensor data source.https://git.flow3r.garden/card10/firmware/-/issues/139App suggestion: reminder to get up when you work for too long at your desk2019-08-29T12:24:47ZaxelApp suggestion: reminder to get up when you work for too long at your deskFirst of all, sorry if this isn't the place to suggest app ideas, but at the very last I wanted to capture the idea somewhere useful.
App idea: a card10 app that reminds you to get up and move if it detects you haven't been moving for a...First of all, sorry if this isn't the place to suggest app ideas, but at the very last I wanted to capture the idea somewhere useful.
App idea: a card10 app that reminds you to get up and move if it detects you haven't been moving for an hour. Good for those who work at a desk and can get absorbed in work.
Could be based on the code from https://badge.team/projects/sleeptracker, which detects periods of lack of movement.
My coding skills are very limited, otherwise I'd try to hash out some code to do this. I might still try!
Cheers
axelhttps://git.flow3r.garden/card10/firmware/-/issues/141ble: fix documentation endian2019-10-18T14:43:00Zgenofireble: fix documentation endianafter merging:
https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/227
https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/242
https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/255...after merging:
https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/227
https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/242
https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/255
detailed in:
https://git.card10.badge.events.ccc.de/card10/firmware/merge_requests/255genofiregenofirehttps://git.flow3r.garden/card10/firmware/-/issues/143File-Transfer Enhancements2019-09-02T14:17:49Zrahixcard10@rahix.deFile-Transfer EnhancementsWe want to allow enabling/disabling file-transfers in `card10.cfg`. ref !213We want to allow enabling/disabling file-transfers in `card10.cfg`. ref !213https://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 infohttps://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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/197BLE: Client Characteristic Configuration data not read correctly from AppDB2020-12-20T15:31:31ZschneiderBLE: Client Characteristic Configuration data not read correctly from AppDBObserved behaviour:
- Connect an Android device, enable notifications for the battery service.
- Observe notifications of the battery state arriving
- Disconnect the Android device
- Restart the card10
- Connect the Android device
- Obse...Observed behaviour:
- Connect an Android device, enable notifications for the battery service.
- Observe notifications of the battery state arriving
- Disconnect the Android device
- Restart the card10
- Connect the Android device
- Observe no notifications of the battery state arriving anymore
- Disconnect the Android device
- Connect the Android device
- Observe notifications of the battery state arriving
Desired behaviour:
- Connect an Android device, enable notifications for the battery service.
- Observe notifications of the battery state arriving
- Disconnect the Android device
- Restart the card10
- Connect the Android device
- Observe notifications of the battery state arriving
Investigation:
When opening a connection from an Android device, the stack tries to read persisted CCC data from the AppDB. This data is stored together with other pairing information and is persisted once notifications are enabled for a characteristic by a certain client/connection/bonding.
When a new connection is opened, `AppServerConnCback()` in `stack/ble-profiles/sources/apps/app/app_server.c` tries to read this information again. It uses `AppDbGetHdl(connId)` to resolve the `appDbHdl_t` which contains this data. This fails when connecting for the first time as there is no AppDb handle available yet for this `connId`.
The mapping of `connId` to AppDb handle is held in `appConnCb_t appConnCb[DM_CONN_MAX]` which is part of `stack/ble-profiles/sources/apps/app/app_main.c`. It looks like it gets updated in `stack/ble-profiles/sources/apps/app/app_master.c` and `stack/ble-profiles/sources/apps/app/app_slave.c`.
Some function in `app_master.c` or `app_slave.c` later on updates the mapping. Looks like it is in `appSlaveResolvedAddrInd()` as the Android device is using private addresses which first have to be resolved using pairing information (AFAIK). This though happens after consulting the mapping for the CCC data.
Conclusion:
It looks like the stack tries to read persisted CCC data before the mapping from connection to AppDb entry has been established. In fact the read is performed on outdated information from the previous connection (possibly being a security issue).
Writing this down to not forget about it and test with an mbed board, using an upstream version of the stack.https://git.flow3r.garden/card10/firmware/-/issues/198Add proper hardfaults handlers2021-01-16T11:35:00Zrahixcard10@rahix.deAdd proper hardfaults handlersRight now, we don't deal well with hardfaults:
- _Epicardium_ just becomes unresponsive and at some point the watchdog kicks in.
- _Pycardium_ `epic_exit()`s with ret-code 255 which will at least be logged to the console but no user fee...Right now, we don't deal well with hardfaults:
- _Epicardium_ just becomes unresponsive and at some point the watchdog kicks in.
- _Pycardium_ `epic_exit()`s with ret-code 255 which will at least be logged to the console but no user feed-back nor a stacktrace either.
- _l0dables_ don't have any handling by default.
MR !79 has a basic implementation of a HardFault handler which could be repurposed for this in tandem with the new `panic()` functionality.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/issues/200Revisit BLE connection parameters2020-10-17T13:23:52ZschneiderRevisit BLE connection parametersRight now they are chosen based on a mix of defaults from the SDK examples and later optimization.
Apple actually has a small guide for them: https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf (Section 35).
This is...Right now they are chosen based on a mix of defaults from the SDK examples and later optimization.
Apple actually has a small guide for them: https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf (Section 35).
This issue is concerned with connection interval, latency, MTU, etc.https://git.flow3r.garden/card10/firmware/-/issues/201BLE: Add support for Battery Service and Apple Notification Center Service (A...2020-10-17T13:22:00ZschneiderBLE: Add support for Battery Service and Apple Notification Center Service (ANCS)Adding support for these services (which run on the phone!) would make the card10 usable without a dedicated app on Apple devices.Adding support for these services (which run on the phone!) would make the card10 usable without a dedicated app on Apple devices.https://git.flow3r.garden/card10/firmware/-/issues/202Default Apps2021-11-16T22:40:15ZmalteDefault AppsHi,
I feel like the selection of preloaded apps does not resemble the landscape of *available* card10 apps anymore, and we deserve something like [Niklas Roy](https://git.card10.badge.events.ccc.de/royrobotiks)'s [Control Center](https:...Hi,
I feel like the selection of preloaded apps does not resemble the landscape of *available* card10 apps anymore, and we deserve something like [Niklas Roy](https://git.card10.badge.events.ccc.de/royrobotiks)'s [Control Center](https://badge.team/projects/control_center) as the default app, and apps like CryptKiddie's [Colorful Flashlight](https://badge.team/projects/colorfulflashlight) in the selection of preloaded apps.
On the other side, and maybe I'm missing some points here, I don't really know what to do with apps like LSD Nickname, Personal State, Adventure Time (like, I really like the thought, but the whimsicality of the naming should be reflected in the app itself?), Scope (as long as it is not extended to the functionality teasered in the metadata.json) and, if Control Center (or [Control Centre](https://codeberg.org/mdik/control_centre)😅) would be preloaded, the Analog and Digital Clocks wouldn't be *too* useful as well.
Like, all apps and experiments are awesome! But do they help people who turn on the card10 for the first time to understand all its capabilities, or are they more confusing?
Thank you for your consideration, and sincerely,
Maltev1.19https://git.flow3r.garden/card10/firmware/-/issues/205Periodically re-seed CSPRNG2020-09-19T22:01:26ZschneiderPeriodically re-seed CSPRNGThe CSPRNG introduced with !399 is only seeded once during boot. It should be re-seeded periodically if possible.The CSPRNG introduced with !399 is only seeded once during boot. It should be re-seeded periodically if possible.https://git.flow3r.garden/card10/firmware/-/issues/213Follow-up from "Pycardium Improvements"2021-11-16T22:40:21Zrahixcard10@rahix.deFollow-up from "Pycardium Improvements"The following discussion from !417 should be addressed:
- [ ] @schneider started a [discussion](https://git.card10.badge.events.ccc.de/card10/firmware/-/merge_requests/417#note_7950): (+1 comment)
> When pressing CTRL+C and then C...The following discussion from !417 should be addressed:
- [ ] @schneider started a [discussion](https://git.card10.badge.events.ccc.de/card10/firmware/-/merge_requests/417#note_7950): (+1 comment)
> When pressing CTRL+C and then CTRL+D one now ends up in the menu. I think before the main app was started again. Is that intended?
>
> I'm wondering if we can maybe make use of this: Allow the menu to react to cursor keys or present a small menu on the console as well. Would eliminate the need to press buttons during development.v1.19https://git.flow3r.garden/card10/firmware/-/issues/214SpO2: Determine calibration factors for MAX861502023-04-17T09:53:13ZschneiderSpO2: Determine calibration factors for MAX86150!414 introduced a demo app for SpO2 estimation using the MAX86150. It's results for SpO2 are not reliable though.
https://git.card10.badge.events.ccc.de/card10/firmware/-/issues/196 discusses details of how SpO2 is estimated using these...!414 introduced a demo app for SpO2 estimation using the MAX86150. It's results for SpO2 are not reliable though.
https://git.card10.badge.events.ccc.de/card10/firmware/-/issues/196 discusses details of how SpO2 is estimated using these algorithms. We currently implement an algorithm from Maxim based on the code for their RD117 reference design. What we are missing at the moment are the calibration values for the MAX86150 to at least get somehow reasonable results.
![IMG_20200426_015712](/uploads/b3864c60254a484ea49d2dcf76b3f9fb/IMG_20200426_015712.jpg)
The estimated SpO2 values are generally too high. Heart rate seems to work if the finger is pressed on "correctly". I can imagine that it might be necessary to design a (printed) spacer around the sensor to have repeatable results.https://git.flow3r.garden/card10/firmware/-/issues/216BHI accleration sensor sometimes does not send updates2020-11-04T22:46:57ZschneiderBHI accleration sensor sometimes does not send updatesI've modified menu.py and g-watch/__init_.py a bit:
- Reduce timeout in menu.py to 3 seconds
- Exit g-watch once a sample from the accelerometer comes in
This puts the card10 into a loop where it repeatedly starts the g-watch. After a...I've modified menu.py and g-watch/__init_.py a bit:
- Reduce timeout in menu.py to 3 seconds
- Exit g-watch once a sample from the accelerometer comes in
This puts the card10 into a loop where it repeatedly starts the g-watch. After a few hours it stops doing so because the g-watch does not receive new sensor data anymore.
Backtrace:
```
(gdb) task_backtrace bhi160_task_id
FPU is off
#0 0x10023f30 in vPortExitCritical () at ../lib/./FreeRTOS/./Source/portable/GCC/ARM_CM4F/portmacro.h:229
#1 0x100234de in ulTaskNotifyTake (xClearCountOnExit=536920208, xClearCountOnExit@entry=1, xTicksToWait=536920196, xTicksToWait@entry=2000) at ../lib/FreeRTOS/Source/tasks.c:4599
#2 0x100114bc in vBhi160Task (pvParameters=<optimized out>) at ../epicardium/modules/bhi.c:530
#3 0x10023e20 in ?? () at ../lib/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c:703
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
```https://git.flow3r.garden/card10/firmware/-/issues/219GDB: Consider disabling the watchdog when attaching2020-11-04T22:32:55ZschneiderGDB: Consider disabling the watchdog when attachingThe first time you attach to a running card10, the watchdog is still running. This prevents useful debugging until the first reset which then checks the debugger flag and does not initialize the watchdog again.
We could consider to eith...The first time you attach to a running card10, the watchdog is still running. This prevents useful debugging until the first reset which then checks the debugger flag and does not initialize the watchdog again.
We could consider to either
- Disable the watchdog in firmware as soon as we see an attached debugger.
or
- Disable the watchdog from GDB when attaching.https://git.flow3r.garden/card10/firmware/-/issues/220non-blocking reads from serial?2020-11-14T11:16:35ZSven Knebelnon-blocking reads from serial?I'd like to write an app that talks to a program on my PC bidirectionally (kind of as a remote and utility display: send key presses and sensor values from the card10 to the PC, allow the PC to ask the card10 to blink LEDs/update display...I'd like to write an app that talks to a program on my PC bidirectionally (kind of as a remote and utility display: send key presses and sensor values from the card10 to the PC, allow the PC to ask the card10 to blink LEDs/update display contents). The obvious way seems to be the USB-serial.
With `print()` I can send text to the PC, but I would like a non-blocking way to check for data being sent from the PC, so that in an app main loop that reads sensors, controls LED blinking, ... this is just another step that checks for commands coming in.
I'm flexible in what this specifically looks like, some ideas:
* micropython seems to have a streams abstraction that maybe could wrap the serial input and seems to support this: http://docs.micropython.org/en/latest/library/uio.html (referenced from https://firmware.card10.badge.events.ccc.de/pycardium/stdlib.html#uio)
* it could be a function specific to the "standard output" matching `print()`, e.g. a `try_input()` that returns whatever is in the input buffer without waiting or a function to check if there is anything in the input buffer.
Possible workaround: I assume with `input()` I can do a blocking read of a line of text (haven't tested this yet), but that would rely on the PC-side constantly sending newlines to not block the app in that call, which doesn't seem ideal.https://git.flow3r.garden/card10/firmware/-/issues/221Save data to ram2020-12-20T15:56:30ZPixtxaSave data to ram- Save data to ram, so less flash writes are needed and data is not lost when app is changed
- Would be nice to write (maybe also read) data ofer ble from smartphone (spaceapi state, bitcoin price, outside temperature, …)
- keep data whe...- Save data to ram, so less flash writes are needed and data is not lost when app is changed
- Would be nice to write (maybe also read) data ofer ble from smartphone (spaceapi state, bitcoin price, outside temperature, …)
- keep data when sleeping, so nothing gets lost on empty batteryhttps://git.flow3r.garden/card10/firmware/-/issues/222Shutdown handler2020-12-20T15:58:37ZPixtxaShutdown handler- Would be nice to have one or two functions, that is/are called before standby (manual/empty batt) and gets a few seconds to run.
- I don't like the long, loud vibration, for me it could be much shorter. Baybe it also would be nice to b...- Would be nice to have one or two functions, that is/are called before standby (manual/empty batt) and gets a few seconds to run.
- I don't like the long, loud vibration, for me it could be much shorter. Baybe it also would be nice to blind an led, show a custumised shutdown screen, deinit hardware on or send a power off message to something
- Together with [Save data to ram](https://git.card10.badge.events.ccc.de/card10/firmware/-/issues/221) it may also be nice to save some data from ram to flash before going to sleep.https://git.flow3r.garden/card10/firmware/-/issues/223FreeRTOS exception waking the MAX86150 task2020-12-26T15:53:54ZschneiderFreeRTOS exception waking the MAX86150 taskHappened after using the MAX86150 for a few hours:
```
2020-12-25 12:12:56.573 --- SYSTEM PANIC ---
2020-12-25 12:12:56.574 --- ---
2020-12-25 12:12:56.577 --- ---
2020-12...Happened after using the MAX86150 for a few hours:
```
2020-12-25 12:12:56.573 --- SYSTEM PANIC ---
2020-12-25 12:12:56.574 --- ---
2020-12-25 12:12:56.577 --- ---
2020-12-25 12:12:56.581 A fatal error occured:
2020-12-25 12:12:56.582 Assertion failure:
2020-12-25 12:12:56.589 "( ( &( pxTCB->xEventListItem ) )->pvContainer ) == ((void *)0)"
2020-12-25 12:12:56.593 failed in "../lib/FreeRTOS/Source/tasks.c:5001",
2020-12-25 12:12:56.597 function: vTaskNotifyGiveFromISR()
2020-12-25 12:12:56.598
2020-12-25 12:12:56.601 Firmware Version:
2020-12-25 12:12:56.602 v1.16-107-gad28755b-dirty
2020-12-25 12:12:56.605
2020-12-25 12:12:56.605 Stack Trace:
2020-12-25 12:12:56.606 0x10013e07
2020-12-25 12:12:56.609
2020-12-25 12:12:56.613 Please report this error to the card10 firmware team!
2020-12-25 12:12:56.617 -> https://git.card10.badge.events.ccc.de/card10/firmware/issues/new <-
2020-12-25 12:12:56.621 --- ====== ===== ---
```
FreeRTOS code:
```c
void vTaskNotifyGiveFromISR( TaskHandle_t xTaskToNotify, BaseType_t *pxHigherPriorityTaskWoken )
{
TCB_t * pxTCB;
uint8_t ucOriginalNotifyState;
UBaseType_t uxSavedInterruptStatus;
» configASSERT( xTaskToNotify );
» /* RTOS ports that support interrupt nesting have the concept of a
» maximum»system call (or maximum API call) interrupt priority.
» Interrupts that are»above the maximum system call priority are keep
» permanently enabled, even when the RTOS kernel is in a critical section,
» but cannot make any calls to FreeRTOS API functions. If configASSERT()
» is defined in FreeRTOSConfig.h then
» portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion
» failure if a FreeRTOS API function is called from an interrupt that has
» been assigned a priority above the configured maximum system call
» priority. Only FreeRTOS functions that end in FromISR can be called
» from interrupts»that have been assigned a priority at or (logically)
» below the maximum system call interrupt priority. FreeRTOS maintains a
» separate interrupt safe API to ensure interrupt entry is as fast and as
» simple as possible. More information (albeit Cortex-M specific) is
» provided on the following link:
» http://www.freertos.org/RTOS-Cortex-M3-M4.html */
» portASSERT_IF_INTERRUPT_PRIORITY_INVALID();
» pxTCB = xTaskToNotify;
» uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
» {
» » ucOriginalNotifyState = pxTCB->ucNotifyState;
» » pxTCB->ucNotifyState = taskNOTIFICATION_RECEIVED;
» » /* 'Giving' is equivalent to incrementing a count in a counting
» » semaphore. */
» » ( pxTCB->ulNotifiedValue )++;
» » traceTASK_NOTIFY_GIVE_FROM_ISR();
» » /* If the task is in the blocked state specifically to wait for a
» » notification then unblock it now. */
» » if( ucOriginalNotifyState == taskWAITING_NOTIFICATION )
» » {
» » » /* The task should not have been on an event list. */
» » » configASSERT( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) == NULL );
```
Random advice from the Internet: turn on `configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES` as this looks like a memory corruption:
https://www.freertos.org/FreeRTOS_Support_Forum_Archive/July_2018/freertos_xTaskNotify_assertion_50220597j.htmlhttps://git.flow3r.garden/card10/firmware/-/issues/224Exposure Notifications App tries to run with BLE not enabled.2021-01-06T23:41:40ZPhilip StewartExposure Notifications App tries to run with BLE not enabled.If you open the Exposure Notification App without BLE enabled the app runs and silently fails.
Can we add a a message if BLE is off?If you open the Exposure Notification App without BLE enabled the app runs and silently fails.
Can we add a a message if BLE is off?https://git.flow3r.garden/card10/firmware/-/issues/229Consider support via gadgetbridge2021-01-09T16:21:09ZschneiderConsider support via gadgetbridgehttps://gadgetbridge.org/ offers support for a few interesting use-cases on Android for a multitude of BLE devices:
https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/master/FEATURES.md
Example support for Pebble watches:
htt...https://gadgetbridge.org/ offers support for a few interesting use-cases on Android for a multitude of BLE devices:
https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/master/FEATURES.md
Example support for Pebble watches:
https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/master/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebblehttps://git.flow3r.garden/card10/firmware/-/issues/233Follow-up from "Dynamically scale system clock based on load"2021-09-19T10:33:39Zrahixcard10@rahix.deFollow-up from "Dynamically scale system clock based on load"The following discussion from !481 should be addressed:
- [ ] @rahix started a [discussion](https://git.card10.badge.events.ccc.de/card10/firmware/-/merge_requests/481#note_8674):
> In this implementation, we have a kind of two-la...The following discussion from !481 should be addressed:
- [ ] @rahix started a [discussion](https://git.card10.badge.events.ccc.de/card10/firmware/-/merge_requests/481#note_8674):
> In this implementation, we have a kind of two-layer tickless idle implementation. First, the `portSUPPRESS_TICKS_AND_SLEEP()` implementation from the FreeRTOS Cortex-M4 port switches the systick to a lower speed when entering tickless idle. Then we use its hooks (`configPRE_SLEEP_PROCESSING()`) to implement our own tickless idle which kind of undoes the systick work from the FreeRTOS port.
>
> Instead, from looking at <https://www.freertos.org/low-power-tickless-rtos.html> we can just drop the FreeRTOS port code entirely and implement `portSUPPRESS_TICKS_AND_SLEEP()` directly. This reduces the amount of useless work done, allows us to theoretically sleep for as long as we want, and de-clutters the codepaths in our sleep routine.https://git.flow3r.garden/card10/firmware/-/issues/234Pycardium time module does not update time if time zone is changed until inte...2021-09-19T11:02:23ZschneiderPycardium time module does not update time if time zone is changed until interpreter is restartedhttps://git.flow3r.garden/card10/firmware/-/issues/235xeyes: Rewrite using new CTX API2021-10-29T20:10:38Zschneiderxeyes: Rewrite using new CTX APIhttps://git.flow3r.garden/card10/firmware/-/issues/240Update Micropython to fix GCC 12 errors2023-12-05T20:52:41ZFrançois RevolUpdate Micropython to fix GCC 12 errorsTrying to build on a recent Debian Sid with GCC 12.3.1 I get an error:
```
../py/stackctrl.c:32:32: error: storing the address of local variable ‘stack_dummy’ in ‘mp_state_ctx.thread.stack_top’ [-Werror=dangling-pointer=]
32 | MP_...Trying to build on a recent Debian Sid with GCC 12.3.1 I get an error:
```
../py/stackctrl.c:32:32: error: storing the address of local variable ‘stack_dummy’ in ‘mp_state_ctx.thread.stack_top’ [-Werror=dangling-pointer=]
32 | MP_STATE_THREAD(stack_top) = (char *)&stack_dummy;
../py/stackctrl.c:31:18: note: ‘stack_dummy’ declared here
31 | volatile int stack_dummy;
| ^~~~~~~~~~~
```
This was [fixed in Micropython upstream](https://github.com/micropython/micropython/commit/f1c6cb7725960487195daa5c5c196fd8d3563811).
Applying the patch manually on the submodule brings another error:
```
main.c:342:6: error: conflicting types for ‘mp_import_stat’ due to enum/integer mismatch; have ‘uint(const char *)’ {aka ‘unsigned int(const char *)’} [-Werror=enum-int-mismatch]
342 | uint mp_import_stat(const char *path) {
| ^~~~~~~~~~~~~~
```
… which I supposed was probably fixed too upstream.