Page 1 of 2
STM32F105 HAL observations
Posted: Sat Sep 24, 2016 10:31 am
by Beredrim
Hello,
When using the HAL for
STM32F105 from latest stable (
ChibiOs 16.1.5) I encountered some problems.
First up I got:
./os/hal/ports/STM32/STM32F1xx/hal_lld_f105_f107.h:408:22: warning: "STM32_MCOSEL_PLL2DIV2" is not defined [-Wundef]
(STM32_MCOSEL == STM32_MCOSEL_PLL2DIV2) ||
which I believe to be a simple mistake where
STM32_MCOSEL_PLL2DIV2 should be replaced with
STM32_MCOSEL_PLL2 on lines
408 and 468 in hal_lld_f105_f107.h.
Secondly I could not get CAN working, until I added:
Code: Select all
$(CHIBIOS)/os/hal/ports/STM32/LLD/CANv1 \
to the
PLATFORMINC variable in
platform_f105_f107.mk (canv1 is already added to the PLATFORMSRC).
After those changes I could build the project and it appears to be working fine.
However it would ease my mind if anyone could please confirm that those changes seem to be correct?
Best regards and thanks for all your awesome work,
Daniel
Re: STM32F105 HAL observations
Posted: Sat Sep 24, 2016 10:44 am
by RoccoMarco
I will take a look. Thanks.
Re: STM32F105 HAL observations
Posted: Sat Sep 24, 2016 10:52 am
by Giovanni
Moving in the bug reports forum.
Giovanni
Re: STM32F105 HAL observations
Posted: Sat Sep 24, 2016 2:50 pm
by RoccoMarco
First one fixed ad
Bug 779 but I have no hardware to check if it works fine. Please give me a feedback on this.
About second one. I am getting a little bit confused since in platform file I am reading:
Code: Select all
# Required include directories
PLATFORMINC := $(CHIBIOS)/os/hal/ports/common/ARMCMx \
$(CHIBIOS)/os/hal/ports/STM32/STM32F1xx \
$(CHIBIOS)/os/hal/ports/STM32/LLD/CANv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/DACv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/DMAv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/EXTIv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/MACv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/OTGv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/RTCv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/SDIOv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv1 \
$(CHIBIOS)/os/hal/ports/STM32/LLD/xWDGv1
and as you can see the fourth line is
Code: Select all
$(CHIBIOS)/os/hal/ports/STM32/LLD/CANv1 \
Re: STM32F105 HAL observations
Posted: Sat Sep 24, 2016 3:03 pm
by Beredrim
I was just about to post an update about that, hoping to not waste your time. I noticed (somewhat late, sorry) that the second was a duplicate of bug #772, which will be released in release 16.1.6. (
viewtopic.php?f=35&t=3506). Again, sorry for not noticing this before I posted, I will try to do better next time.
Thanks a lot for fixing the first one. That was really fast!
Unfortunately I have no hardware at my hands either at the moment, but I will check on monday and get back to you.
With wishes for a pleasant weekend,
Daniel
Re: STM32F105 HAL observations
Posted: Sat Sep 24, 2016 3:06 pm
by RoccoMarco
No problem. Thanks for bug reporting.
Have a good weekend.
Re: STM32F105 HAL observations
Posted: Mon Sep 26, 2016 9:10 am
by Beredrim
I have just tested with trunk_9803 and my project builds without errors (and seems to work properly) without modifications now.
I have another small question though... and please forgive me if this ends up in the wrong forum, but I do not know where else to put it.
I intend to use only the HAL (os-less) in some of our smaller/simpler projects to be able to give our customers the ability to adapt/modify the code themselves without subjecting them to GPL or requiring them to purchase a license.
I noticed however that one of the files in the hal folder was under GPL license:
os/hal/lib/peripherals/flash/hal_flash.c, whereas the corresponding .h file is not. Is this intentional? I will most likely not use this file in my projects anyway, but as I noticed it, I thought I'd mention it.
Thanks a lot for fixing the other issue so quickly, now I am looking forward even more for the next stable release

Best regards and thanks again for all the awesome work you guys put into this!
/Daniel
Re: STM32F105 HAL observations
Posted: Mon Sep 26, 2016 9:15 am
by RoccoMarco
I think it is an error since hal is under (edit) Apache. BTW these are only interfaces: the implementation which is in EX should be GPL.
I am not sure but your problem could be the OSAL. Check if is under Apache. BTW you could ask for a free commercial licence.
Re: STM32F105 HAL observations
Posted: Mon Sep 26, 2016 10:44 am
by Beredrim
Oh, the hal is under gpl? I was under the impression the HAL was meant to be licensed as Apache?
Regarding licenses, I have looked at the different alternatives, but have not found one which suits us in all cases.
We need our the customers to be able to easily do minor adaptations to the software (and they cannot GPL it since the resulting code would contain sensitive information about e.g. their CAN-protocol).
Furthermore we don't expect big volumes per customer, as it is something of a niche product, solving a special need which may arise in some installations. Having several customers with approximately the same occasional problem, we believe it to be a viable product, but to require them to sign up for a free/non-free commercial license will be very difficult in some cases.
By using the HAL only we would be able to fulfill the needs of the customers which only wants to have a very simple product, and at the same time we can point to ChibiOs commercial licenses for those requiring more functionality. It would be easy for them to plug in RT or NIL instead of os-less.
This is the best solution among the alternatives I have been able to come up with for this product.
Re: STM32F105 HAL observations
Posted: Mon Sep 26, 2016 11:20 am
by RoccoMarco
I screwed up.
The HAL should be under Apache and so should be for flash.c.
P.S. I have checked. OSAL is under Apache too.