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.

Moderators: RoccoMarco, barthess

dflogeras
Posts: 212
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 7 times
Been thanked: 19 times

Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Postby dflogeras » Tue Jul 08, 2014 2:37 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Postby Giovanni » Tue Jul 08, 2014 2:41 pm

Hi,

Are you using configuration files from the latest version?

Giovanni

dflogeras
Posts: 212
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 7 times
Been thanked: 19 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Postby dflogeras » Tue Jul 08, 2014 3:14 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Postby Giovanni » Tue Jul 08, 2014 3:52 pm

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: 212
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 7 times
Been thanked: 19 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Postby dflogeras » Tue Jul 08, 2014 4:10 pm

Excellent, thanks for ChibiOS :)

dflogeras
Posts: 212
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 7 times
Been thanked: 19 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Postby dflogeras » Tue Jul 08, 2014 4:21 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Postby Giovanni » Tue Jul 08, 2014 4:54 pm

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: 212
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 7 times
Been thanked: 19 times

Re: Problem upgrading from 2.6.3 to 2.6.5 on STM32L

Postby dflogeras » Tue Jul 08, 2014 5:05 pm

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


Return to “STM32 Support”

Who is online

Users browsing this forum: Bing [Bot] and 17 guests