Problem upgrading from 2.6.3 to 2.6.5 on STM32L

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Post by dflogeras »

Hi,

I've got a small project that I created using testhal/STM32Lxx/UART as a starting point for the build system. I modified it to use hardware specific to my project, etc.. I also added my own specific STM32L151 port.mk and .ld to specify 10k RAM for my device (again based on the existing one found in os/ports/GCC/ARMCMx/STM32L1xx/ld). As a sidenote, is it possible to get STM32L151x families added to ChibiOS for the benefit of all?

I unzipped the 2.6.5 release, and altered my Makefile to bring in the changes I noticed in the testhal/STM32Lxx/UART project (only keeping those that are specific to my project)

When I attempt to build, it fails with:

Code: Select all

Compiling hal.c
In file included from ../os/hal/include/i2c.h:99:0,
                 from ../os/hal/include/hal.h:59,
                 from ../os/hal/src/hal.c:37:
../os/hal/platforms/STM32/I2Cv1/i2c_lld.h:233:2: error: #error "invalid DMA stream associated to I2C1 RX"
../os/hal/platforms/STM32/I2Cv1/i2c_lld.h:239:2: error: #error "invalid DMA stream associated to I2C1 TX"


(it also fails this way if I left my Makefile as it was in ChibiOS-2.6.3).

I'm looking for advice on how to correct this. The relevant settings in my mcuconf.h are (well, what I think are relevant :):

Code: Select all

mcuconf.h: #define STM32_I2C_USE_I2C1                  TRUE
mcuconf.h:#define STM32_I2C_I2C1_IRQ_PRIORITY         5
mcuconf.h:#define STM32_I2C_I2C1_DMA_PRIORITY         3
mcuconf.h:#define STM32_I2C_I2C1_DMA_ERROR_HOOK()     chSysHalt()
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Post by Giovanni »

Hi,

Are you using configuration files from the latest version?

Giovanni
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Post by dflogeras »

I diffed my chconf.h, mcuconf.h and halconf.h with those included with the 2.6.5 UART testhal program and note the following:

In halconf.h, I've enabled HAL_USE_EXT, HAL_USE_I2C, HAL_USE_RTC

In chconf.h, I've disabled most of the debugging related things.

In mcuconf.h, the only thing that I've noted as suspicious is that STM32_UART_USART1_DMA_PRIORITY (as well as USART2 and 3) are set to 0 in the test program, they are set to 1 in mine. Changing those back to 0's had no effect.

I can post these files if you'd like to have a closer look.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Post by Giovanni »

Hi,

Thanks for finding, there was an error in the STM32L1 registry file, wrong DMA channels were specified. I fixed it already in the repository, the fix will be in version 2.6.6.

Giovanni
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Post by dflogeras »

Excellent, thanks for ChibiOS :)
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Post by dflogeras »

A side question:

I tried the same procedure with ChibiOS-2.6.4, and while it builds fine, when it gets to the end it attempts to run the binary, resulting in:

Code: Select all

Creating build/ch.dmp

qemu: uncaught target signal 4 (Illegal instruction) - core dumped
make: *** [build/ch.dmp] Illegal instruction
make: *** Deleting file `build/ch.dmp'


I have the Linux binfmt driver set up to execute arm binaries through qemu for my raspberry pi chroots (arm1176). Disabling binfmt, I still get:

Code: Select all

Creating build/ch.dmp

build/ch.elf: build/ch.elf: cannot execute binary file
make: *** [build/ch.dmp] Error 126


Is this something I need to disable?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Post by Giovanni »

Strange, it seems a problem in the dump utility, it is not necessary to create the dump file anyway, you may exclude it in rules.mk.

Giovanni
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Post by dflogeras »

OK, I just thought I'd mention it because it doesn't happen in the same environment with 2.6.3.

Thanks again Giovanni!

Dave
Post Reply