ChibiOS 16 and uGFX in EmBitz with Makefile

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

Moderator: RoccoMarco

Post Reply
MobileWill
Posts: 27
Joined: Sat Jan 30, 2016 8:44 am

ChibiOS 16 and uGFX in EmBitz with Makefile

Post by MobileWill »

So I am deep in this rabbit hole and I can't get out.

I have ChibiOS 16 working fine in Embitz without makefile, LED blinks.

Now I am trying to figure out how to add uGFX and its a mess. I tried without a makefile and that was a loss of many hours. Now I am trying with the makefile and I have seemed to make progress but now ChibiOS compiling with Makefile and I am getting errors.

Code: Select all

ChibiOS_16\os\hal\ports\STM32\LLD\DMAv2\stm32_dma.c||In function 'dmaStreamAllocate':|
ChibiOS_16\os\hal\ports\STM32\LLD\DMAv2\stm32_dma.c|473|error: 'STM32_DMA_CR_RESET_VALUE' undeclared (first use in this function)|
ChibiOS_16\os\hal\ports\STM32\LLD\DMAv2\stm32_dma.c|473|note: each undeclared identifier is reported only once for each function it appears in|
ChibiOS_16\os\hal\ports\STM32\LLD\DMAv2\stm32_dma.c|474|error: 'STM32_DMA_FCR_RESET_VALUE' undeclared (first use in this function)|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 13 seconds) ===|


The header in the DMAv2 folder has those defines. But from my chasing files I see other headers that do not have that define. Is there a bug?

The header in os/hal/ports/STM32/STM32F4xx has the other STM32_DMA_CR defines but not RESET. So I am not sure if that is the problem. I am lost and burnt so much time I am not sure what to do.

When I originally got this working without uGFX I think it was using DMAv1 driver. But now that the makefile too over I can't control what is include just by adding it to the IDE folder tree. Should I go back to doing this without the Makefile? I couldn't figure out how to add uGFX and ChibiOS witout the makefile. I like this IDE and trying to do it for a larger project instead of a Eclipsed based IDE.

Thanks for any help. I hope to get this working today so I can sleep ;)

Let me know if I need to post the makefile or others. The makefile is from the template from uGFX.
MobileWill
Posts: 27
Joined: Sat Jan 30, 2016 8:44 am

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Post by MobileWill »

So I think its a bug in the spi_dma.h file for STM32F4xx

I added the two defines

#define STM32_DMA_CR_RESET_VALUE 0x00000000U
#define STM32_DMA_FCR_RESET_VALUE 0x00000021U

to the respective places in

os/hal/ports/STM32/STM32F4xx/stm32_dma.h

Then had to add main.c to the SRC variable to the makefile.

The problem is using the external makefile you totally loose all the functions of the IDE and can't debug. So this is back to the drawing board. I will have to go back to trying single file inclusion again I guess.
MobileWill
Posts: 27
Joined: Sat Jan 30, 2016 8:44 am

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Post by MobileWill »

So I started a fresh embitz project for just ChibiOS. It works great once I get all the correct includes. It seems the DMA driver in the STM32F4xx is the only missing the defines. If I remove those and use DMAv2 instead or add the defines it works fine.

Which DMA driver files should I use? I assume DMAv2?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Post by Giovanni »

Correct, DMAv2 for F4 and F7.

The DMA driver is no more located under STM32/STM32F4xx.

Giovanni
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Post by Tectu »

So did you manage to get both ChibiOS and uGFX running on your hardware using EmBitz?


~ Tectu
MobileWill
Posts: 27
Joined: Sat Jan 30, 2016 8:44 am

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Post by MobileWill »

Tectu wrote:So did you manage to get both ChibiOS and uGFX running on your hardware using EmBitz?


~ Tectu


I did. It went much better on a fresh project,. The first time I used a starter project I found on a post.

With Embitz I partly ignored the uGFX install directions. The best way is single-file inclusion and just add to the tree the needed parts of ChibiOS and ufX plus board drivers. Then in the search directory in build options I added the ugfx, src, and inc directories. I used the started project as a reference to set up the new project so I knew what to include.

I could post my base project if anyone needs it.
MobileWill
Posts: 27
Joined: Sat Jan 30, 2016 8:44 am

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Post by MobileWill »

Also add ChibiOS folder to the search directories.

I wonder if the search directories are even needed since the tree includes should cover it. I should try without the search directories.
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Post by Tectu »

We would love to see your base project. If you can post it either on the uGFX forum (as it might be a bit off-topic for this fourm) or here (if Giovanni doesn't mind) we'd be happy to take a look at it and clean things up if necessary.
If that's okay for you we'd like to include the project as an official demo project that can be downloaded form the uGFX website, similar to the existing projects for Keil uVision.


~ Tectu
fastlink30
Posts: 42
Joined: Tue Aug 12, 2014 1:25 pm

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Post by fastlink30 »

hi MobileWill, is possible have the makefile to compile only for chibios inside embitz?

thanks
MobileWill
Posts: 27
Joined: Sat Jan 30, 2016 8:44 am

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Post by MobileWill »

fastlink30 wrote:hi MobileWill, is possible have the makefile to compile only for chibios inside embitz?

thanks



I believe so. Its been awhile since I have worked on this. I think I got it all working with the makefile.
Post Reply