Page 1 of 1

ChibiOS 16 and uGFX in EmBitz with Makefile

Posted: Sun Jan 31, 2016 1:17 am
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.

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Posted: Sun Jan 31, 2016 4:44 am
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.

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Posted: Sun Jan 31, 2016 7:02 am
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?

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Posted: Sun Jan 31, 2016 7:51 am
by Giovanni
Correct, DMAv2 for F4 and F7.

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

Giovanni

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Posted: Mon Feb 01, 2016 1:12 pm
by Tectu
So did you manage to get both ChibiOS and uGFX running on your hardware using EmBitz?


~ Tectu

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Posted: Mon Feb 01, 2016 5:55 pm
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.

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Posted: Mon Feb 01, 2016 8:36 pm
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.

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Posted: Tue Feb 02, 2016 4:39 pm
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

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Posted: Mon Aug 21, 2017 2:32 pm
by fastlink30
hi MobileWill, is possible have the makefile to compile only for chibios inside embitz?

thanks

Re: ChibiOS 16 and uGFX in EmBitz with Makefile

Posted: Sat Aug 26, 2017 7:18 pm
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.