Search found 552 matches

by ag123
Sun May 28, 2017 4:18 pm
Forum: General discussion
Topic: Partial / old code for a F4 Maple bootloader
Replies: 13
Views: 193

Re: Partial / old code for a F4 Maple bootloader

took a look a the px4 boot loader codes on github, it seemed to give me an impression it is a uart bootloader, but i'm not sure though nope incorrect it seem to use a serial protocol to download / flash the image https://github.com/PX4/Bootloader/blob/master/bl.c#L524 and it seemed usb-serial cdc-ac...
by ag123
Sun May 28, 2017 12:01 pm
Forum: Generic STM32F103
Topic: USB Observations
Replies: 73
Views: 805

Re: USB Observations

it seemed this isn't really about init() itself this time round, rather the *constructor* for UsbSerial is called *twice*, and create goofy scenarios. what seemed necessary is some kind of 'singleton' codes so that there is only 1 instance and that we won't be calling UsbSerial's constructor twice o...
by ag123
Sun May 28, 2017 11:49 am
Forum: Generic STM32F103
Topic: USB Observations
Replies: 73
Views: 805

Re: USB Observations

in this case it seem to be the double initialization UsbSerial.begin() that's causing the trouble. would it help if we use a singleton pattern? e.g. class UsbSerial { public: static UsbSerial* getInstance() { static UsbSerial static_usbserial; return &static_usbserial; } } then codes that wants ...
by ag123
Sun May 28, 2017 10:14 am
Forum: Generic STM32F103
Topic: USB Observations
Replies: 73
Views: 805

Re: USB Observations

i don't think it matters as if you trace the codes e.g. using debug, those are basically common c functions, i.e. both init() and main(); but the usb codes and usb itself is rather complex and it would likely take some time to analyse and determine the root cause of issues note that the *specai stat...
by ag123
Sun May 28, 2017 10:07 am
Forum: Generic STM32F103
Topic: USB Observations
Replies: 73
Views: 805

Re: USB Observations

as i've not gone in and examine the usb codes, i couldn't tell if it is indeed the cause. but based on the analysis of the boot sequence init() is not really different from main(), they are plain c functions i've been toying with the idea that we call init(), setup() and loop() in main() main() { in...
by ag123
Sun May 28, 2017 9:53 am
Forum: Generic STM32F103
Topic: USB Observations
Replies: 73
Views: 805

Re: USB Observations

i read somewhere that 'volatile' is to tell the compiler/cpu to read that value from memory/gpio rather than perhaps take the value from cache i.e. the variable is deemed 'volatile' if the value can change even if the cpu itself 'did nothing'. this would be true for gpio registers but i've not dug d...
by ag123
Sun May 28, 2017 9:45 am
Forum: Code snipplets
Topic: stm32duino (f1) bootstrap
Replies: 1
Views: 23

Re: stm32duino (f1) bootstrap

i'm not really against the special 'constructor' hook __attribute__(( constructor (101))) void premain() { init(); } despite that this feature is rather obscure. the statement __attribute__(( constructor (101))) causes premain() to be inserted into __preinit_array_start[i] this is a set of codes cal...
by ag123
Sun May 28, 2017 9:40 am
Forum: Code snipplets
Topic: stm32duino (f1) bootstrap
Replies: 1
Views: 23

stm32duino (f1) bootstrap

this post is some of my findings examining the current bootstrap sequences in stm32f1 duino codes --------------- there are things that run before main() executes, this is how it works in the variant's folder e.g. STM32F1/variants/maple_mini/wirish there is start.S and start_c.c, the call graph star...
by ag123
Sun May 28, 2017 9:31 am
Forum: Generic STM32F103
Topic: USB Observations
Replies: 73
Views: 805

Re: USB Observations

there are some discussions about some variables needing to be declared 'volatile' or otherwise the compiler may 'optimise away' some codes, i'd guess we may need to dig deeper into the usb codes if indeed we suspect it is related to those 'volatile' declarations. i think this recent fix by edogaldo ...
by ag123
Sun May 28, 2017 8:41 am
Forum: Generic STM32F103
Topic: USB Observations
Replies: 73
Views: 805

Re: USB Observations

calling codes directly in main() which isn't board specific is not a good idea, as you would likely run into a different board that perhaps runs a differently named class that initialize SerialUSB e.g. in the F4 core it would be named SerialUSB rather than Serial e.g. in the F4 (black/generic) branc...

Go to advanced search