I'll try this in the morning. I am seeing it crash on a malloc during init.arkadiusz.makarenko wrote: ↑Wed Mar 11, 2020 10:04 pmterriblefire wrote: ↑Wed Mar 11, 2020 7:32 pm I've tried firing it up and with one device i always get hardfaults and the other i get...
hardfault.JPG
Basically looks like the 105 doesnt have the RAM for what we're trying to do
This can only happen on usb disconnects. There must be a bug which screws something up.(I suspect mouse init - buffer length allocation). I will try to investigate this.
I have built hid2ami and written my own firmware on f105, and devices which I have at home do behave, so only way forward is to find more devices and trace this issue.
TF Riser Revision 0 Arrives
Moderators: terriblefire, Terriblefire Moderator
-
- Moderator Team
- Posts: 5389
- Joined: Mon Aug 28, 2017 10:56 pm
- Location: Glasgow, UK
Re: TF Riser Revision 0 Arrives
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
- arkadiusz.makarenko
- Moderator Team
- Posts: 1208
- Joined: Wed Jun 19, 2019 7:36 am
- Location: Edinburgh
Re: TF Riser Revision 0 Arrives
Maybe heap and stack is set too low?
It never solved any of my issues, but who knows maybe this time?
It never solved any of my issues, but who knows maybe this time?
Do not trust people. They are capable of greatness.
~ Stanislaw Lem
~ Stanislaw Lem
- arkadiusz.makarenko
- Moderator Team
- Posts: 1208
- Joined: Wed Jun 19, 2019 7:36 am
- Location: Edinburgh
Re: TF Riser Revision 0 Arrives
I think I will remove malloc and create concrete instances on pData array. This way I will break "universal" character of this library, it will be only for HID devices, but this way memory will be allocated for HID_Handlers this from the start.
Do not trust people. They are capable of greatness.
~ Stanislaw Lem
~ Stanislaw Lem
-
- Moderator Team
- Posts: 5389
- Joined: Mon Aug 28, 2017 10:56 pm
- Location: Glasgow, UK
Re: TF Riser Revision 0 Arrives
Code: Select all
002:002:001:DESCRIPTOR 1584035698.286893
05 01 09 02 A1 01 85 02 09 01 A1 00 05 09 19 01
29 10 15 00 25 01 95 10 75 01 81 02 05 01 16 01
F8 26 FF 07 75 0C 95 02 09 30 09 31 81 06 15 81
25 7F 75 08 95 01 09 38 81 06 05 0C 0A 38 02 95
01 81 06 C0 C0 05 0C 09 01 A1 01 85 03 75 10 95
02 15 01 26 8C 02 19 01 2A 8C 02 81 00 C0 05 01
09 80 A1 01 85 04 75 02 95 01 15 01 25 03 09 82
09 81 09 83 81 60 75 06 81 03 C0 06 00 FF 09 01
A1 01 85 10 75 08 95 06 15 00 26 FF 00 09 01 81
00 09 01 91 00 C0 06 00 FF 09 02 A1 01 85 11 75
08 95 13 15 00 26 FF 00 09 02 81 00 09 02 91 00
C0
002:002:000:DESCRIPTOR 1584035698.303352
05 01 09 06 A1 01 05 07 19 E0 29 E7 15 00 25 01
75 01 95 08 81 02 81 03 95 05 05 08 19 01 29 05
91 02 95 01 75 03 91 01 95 06 75 08 15 00 26 A4
00 05 07 19 00 2A A4 00 81 00 C0
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
- arkadiusz.makarenko
- Moderator Team
- Posts: 1208
- Joined: Wed Jun 19, 2019 7:36 am
- Location: Edinburgh
Re: TF Riser Revision 0 Arrives
@terriblefire
My device has exactly the same HID descriptors...
It must be memory allocation issue :/
EDIT:
YEY. I managed to reproduce the bug. I am on it
Arek
My device has exactly the same HID descriptors...
It must be memory allocation issue :/
EDIT:
YEY. I managed to reproduce the bug. I am on it
Arek
Do not trust people. They are capable of greatness.
~ Stanislaw Lem
~ Stanislaw Lem
- arkadiusz.makarenko
- Moderator Team
- Posts: 1208
- Joined: Wed Jun 19, 2019 7:36 am
- Location: Edinburgh
Re: TF Riser Revision 0 Arrives
@terriblefire
Could you try this firmware?
I replaced malloc with global initialization, and it behaves now on my build.
I have replaced f730 with new f105. We should be on the same page now.
I know it is crude, but apparently using malloc on microcontrollers is not recommended. I cannot run away form it, as I need to allocate dynamic size for each hid report, but apparently less is better.
https://github.com/arkadiuszmakarenko/TFRiserF105
Could you try this firmware?
I replaced malloc with global initialization, and it behaves now on my build.
I have replaced f730 with new f105. We should be on the same page now.
I know it is crude, but apparently using malloc on microcontrollers is not recommended. I cannot run away form it, as I need to allocate dynamic size for each hid report, but apparently less is better.
https://github.com/arkadiuszmakarenko/TFRiserF105
Do not trust people. They are capable of greatness.
~ Stanislaw Lem
~ Stanislaw Lem
-
- Moderator Team
- Posts: 5389
- Joined: Mon Aug 28, 2017 10:56 pm
- Location: Glasgow, UK
Re: TF Riser Revision 0 Arrives
Ok i'll try get to test this ASAP
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
- arkadiusz.makarenko
- Moderator Team
- Posts: 1208
- Joined: Wed Jun 19, 2019 7:36 am
- Location: Edinburgh
Re: TF Riser Revision 0 Arrives
It looks that we are in fact running out of memory, but I had this for a moment on 256k RAM, so it did suggest that there is memory leak.
When I removed banner() and commented all printf() there was enough for normal operation. I need to investigate implementation and configuration of printf(), as it appears like ram was never free() after use?
When I removed banner() and commented all printf() there was enough for normal operation. I need to investigate implementation and configuration of printf(), as it appears like ram was never free() after use?
Do not trust people. They are capable of greatness.
~ Stanislaw Lem
~ Stanislaw Lem
-
- Moderator Team
- Posts: 5389
- Joined: Mon Aug 28, 2017 10:56 pm
- Location: Glasgow, UK
Re: TF Riser Revision 0 Arrives
Yes i found this. Printf with params leaks like crazy but i never tracked it down.arkadiusz.makarenko wrote: ↑Fri Mar 13, 2020 8:02 pm It looks that we are in fact running out of memory, but I had this for a moment on 256k RAM, so it did suggest that there is memory leak.
When I removed banner() and commented all printf() there was enough for normal operation. I need to investigate implementation and configuration of printf(), as it appears like ram was never free() after use?
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
-
- Moderator Team
- Posts: 5389
- Joined: Mon Aug 28, 2017 10:56 pm
- Location: Glasgow, UK
Re: TF Riser Revision 0 Arrives
Ok no crashes but the mouse delta types are all screwed up from what i originally posted.
Mouse datacomes from the mouse as an unsigned byte which needs to be cast to a signed byte (128-255) -ve, (0-127) +ive...
this needs to be accumulated in the buffer as a signed 16 bit because you can get multiple mouse events per transmission to the amiga.
You accumulate this in a further layer to emulate joy0dat and joy1dat.
You are sending the raw joy0dat and joy1dats to the CPLD. its dumb and doesnt have the gates to do math.
Mouse datacomes from the mouse as an unsigned byte which needs to be cast to a signed byte (128-255) -ve, (0-127) +ive...
this needs to be accumulated in the buffer as a signed 16 bit because you can get multiple mouse events per transmission to the amiga.
You accumulate this in a further layer to emulate joy0dat and joy1dat.
You are sending the raw joy0dat and joy1dats to the CPLD. its dumb and doesnt have the gates to do math.
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."