Synth port attempt - A noob trying to port...

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
Post Reply
stmNoob0xFF
Posts: 5
Joined: Mon Aug 01, 2016 2:23 pm

Synth port attempt - A noob trying to port...

Post by stmNoob0xFF » Wed Aug 03, 2016 4:01 pm

I wanted to give porting a standard lib / compile a go.
(This is kind of my first attempt, I have tried in the past with other things, which were a bit hit and miss).

I found this code which works if I flash the .hex file via ST-Link:

https://github.com/MrBlueXav/Dekrispator_v2

I put all the '.c' and '.h' files in to one file in my libraries folder under 'main'.
I then changed 'int main(void)' to 'int loop(void)' / 'void loop(void)' / 'void loop()' ..
I also dropped in 'void setup()'.

It seemed to pick up, to a point.
(Bear in mind I'm not even sure this is the right way of doing this?).

Now I am getting a whole load of errors, which are totally above my head (I get an idea of what they are saying, completely unclear as to how to fix).
I know that this is probably a far too advanced place to start.

These are my current errors:

Code: Select all

                 from C:\Users\Games\Documents\Arduino\libraries\main/audio_conf.h:20,
                 from C:\Users\Games\AppData\Local\Temp\build1752890727166045145.tmp\audio_conf.c:28:
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_i2s.h:124:3: error: unknown type name 'SPI_TypeDef'
   SPI_TypeDef                *Instance;    /* I2S registers base address        */
   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_i2s.h:130:3: error: unknown type name '__IO'
   __IO uint16_t              TxXferSize;   /* I2S Tx transfer size              */
   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_i2s.h:130:30: error: expected ':', ',', ';', '}' or '__attribute__' before 'TxXferSize'
   __IO uint16_t              TxXferSize;   /* I2S Tx transfer size              */
                              ^
In file included from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_conf.h:344:0,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal.h:48,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery.h:48,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery_audio.h:51,
                 from C:\Users\Games\Documents\Arduino\libraries\main/audio_conf.h:20,
                 from C:\Users\Games\AppData\Local\Temp\build1752890727166045145.tmp\audio_conf.c:28:
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_spi.h:138:3: error: unknown type name 'SPI_TypeDef'
   SPI_TypeDef                *Instance;    /* SPI registers base address */
   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_spi.h:164:3: error: unknown type name '__IO'
   __IO HAL_SPI_StateTypeDef  State;        /* SPI communication state */
   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_spi.h:164:30: error: expected ':', ',', ';', '}' or '__attribute__' before 'State'
   __IO HAL_SPI_StateTypeDef  State;        /* SPI communication state */
                              ^
In file included from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_conf.h:348:0,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal.h:48,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery.h:48,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery_audio.h:51,
                 from C:\Users\Games\Documents\Arduino\libraries\main/audio_conf.h:20,
                 from C:\Users\Games\AppData\Local\Temp\build1752890727166045145.tmp\audio_conf.c:28:
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_tim.h:288:3: error: unknown type name 'TIM_TypeDef'
   TIM_TypeDef                 *Instance;     /*!< Register base address             */
   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_tim.h:294:3: error: unknown type name '__IO'
   __IO HAL_TIM_StateTypeDef   State;         /*!< TIM operation state               */
   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_tim.h:294:31: error: expected ':', ',', ';', '}' or '__attribute__' before 'State'
   __IO HAL_TIM_StateTypeDef   State;         /*!< TIM operation state               */
                               ^
In file included from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_conf.h:348:0,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal.h:48,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery.h:48,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery_audio.h:51,
                 from C:\Users\Games\Documents\Arduino\libraries\main/audio_conf.h:20,
                 from C:\Users\Games\AppData\Local\Temp\build1752890727166045145.tmp\audio_conf.c:28:
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_tim.h:1465:25: error: unknown type name 'TIM_TypeDef'
 void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure);
                         ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_tim.h:1466:24: error: unknown type name 'TIM_TypeDef'
 void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, uint32_t TIM_ICFilter);
                        ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_tim.h:1467:24: error: unknown type name 'TIM_TypeDef'
 void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config);
                        ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_tim.h:1471:24: error: unknown type name 'TIM_TypeDef'
 void TIM_CCxChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelState);
                        ^
In file included from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_hcd.h:47:0,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_conf.h:376,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal.h:48,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery.h:48,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery_audio.h:51,
                 from C:\Users\Games\Documents\Arduino\libraries\main/audio_conf.h:20,
                 from C:\Users\Games\AppData\Local\Temp\build1752890727166045145.tmp\audio_conf.c:28:
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:392:32: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_CoreInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef Init);
                                ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:393:31: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_DevInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef Init);
                               ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:394:39: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_EnableGlobalInt(USB_OTG_GlobalTypeDef *USBx);
                                       ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:395:40: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_DisableGlobalInt(USB_OTG_GlobalTypeDef *USBx);
                                        ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:396:38: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_SetCurrentMode(USB_OTG_GlobalTypeDef *USBx , USB_OTG_ModeTypeDef mode);
                                      ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:397:35: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_SetDevSpeed(USB_OTG_GlobalTypeDef *USBx , uint8_t speed);
                                   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:398:36: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_FlushRxFifo (USB_OTG_GlobalTypeDef *USBx);
                                    ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:399:36: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_FlushTxFifo (USB_OTG_GlobalTypeDef *USBx, uint32_t num );
                                    ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:400:40: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_ActivateEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
                                        ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:401:42: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_DeactivateEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
                                          ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:402:49: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_ActivateDedicatedEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
                                                 ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:403:51: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_DeactivateDedicatedEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
                                                   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:404:35: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_EPStartXfer(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep, uint8_t dma);
                                   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:405:36: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_EP0StartXfer(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep, uint8_t dma);
                                    ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:406:35: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len, uint8_t dma);
                                   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:407:34: error: unknown type name 'USB_OTG_GlobalTypeDef'
 void *            USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len);
                                  ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:408:34: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_EPSetStall(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep);
                                  ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:409:36: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_EPClearStall(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep);
                                    ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:410:38: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_SetDevAddress (USB_OTG_GlobalTypeDef *USBx, uint8_t address);
                                      ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:411:35: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_DevConnect (USB_OTG_GlobalTypeDef *USBx);
                                   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:412:38: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_DevDisconnect (USB_OTG_GlobalTypeDef *USBx);
                                      ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:413:34: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_StopDevice(USB_OTG_GlobalTypeDef *USBx);
                                  ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:414:38: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_ActivateSetup (USB_OTG_GlobalTypeDef *USBx);
                                      ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:415:36: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_EP0_OutStart(USB_OTG_GlobalTypeDef *USBx, uint8_t dma, uint8_t *psetup);
                                    ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:416:35: error: unknown type name 'USB_OTG_GlobalTypeDef'
 uint8_t           USB_GetDevSpeed(USB_OTG_GlobalTypeDef *USBx);
                                   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:417:31: error: unknown type name 'USB_OTG_GlobalTypeDef'
 uint32_t          USB_GetMode(USB_OTG_GlobalTypeDef *USBx);
                               ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:418:39: error: unknown type name 'USB_OTG_GlobalTypeDef'
 uint32_t          USB_ReadInterrupts (USB_OTG_GlobalTypeDef *USBx);
                                       ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:419:49: error: unknown type name 'USB_OTG_GlobalTypeDef'
 uint32_t          USB_ReadDevAllOutEpInterrupt (USB_OTG_GlobalTypeDef *USBx);
                                                 ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:420:46: error: unknown type name 'USB_OTG_GlobalTypeDef'
 uint32_t          USB_ReadDevOutEPInterrupt (USB_OTG_GlobalTypeDef *USBx , uint8_t epnum);
                                              ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:421:48: error: unknown type name 'USB_OTG_GlobalTypeDef'
 uint32_t          USB_ReadDevAllInEpInterrupt (USB_OTG_GlobalTypeDef *USBx);
                                                ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:422:45: error: unknown type name 'USB_OTG_GlobalTypeDef'
 uint32_t          USB_ReadDevInEPInterrupt (USB_OTG_GlobalTypeDef *USBx , uint8_t epnum);
                                             ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:423:40: error: unknown type name 'USB_OTG_GlobalTypeDef'
 void              USB_ClearInterrupts (USB_OTG_GlobalTypeDef *USBx, uint32_t interrupt);
                                        ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:425:33: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_HostInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg);
                                 ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:426:39: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_InitFSLSPClkSel(USB_OTG_GlobalTypeDef *USBx , uint8_t freq);
                                       ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:427:33: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_ResetPort(USB_OTG_GlobalTypeDef *USBx);
                                 ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:428:34: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_DriveVbus (USB_OTG_GlobalTypeDef *USBx, uint8_t state);
                                  ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:429:37: error: unknown type name 'USB_OTG_GlobalTypeDef'
 uint32_t          USB_GetHostSpeed (USB_OTG_GlobalTypeDef *USBx);
                                     ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:430:40: error: unknown type name 'USB_OTG_GlobalTypeDef'
 uint32_t          USB_GetCurrentFrame (USB_OTG_GlobalTypeDef *USBx);
                                        ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:431:31: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_HC_Init(USB_OTG_GlobalTypeDef *USBx,  
                               ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:438:36: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_HC_StartXfer(USB_OTG_GlobalTypeDef *USBx, USB_OTG_HCTypeDef *hc, uint8_t dma);
                                    ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:439:41: error: unknown type name 'USB_OTG_GlobalTypeDef'
 uint32_t          USB_HC_ReadInterrupt (USB_OTG_GlobalTypeDef *USBx);
                                         ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:440:31: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_HC_Halt(USB_OTG_GlobalTypeDef *USBx , uint8_t hc_num);
                               ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:441:30: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_DoPing(USB_OTG_GlobalTypeDef *USBx , uint8_t ch_num);
                              ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_ll_usb.h:442:32: error: unknown type name 'USB_OTG_GlobalTypeDef'
 HAL_StatusTypeDef USB_StopHost(USB_OTG_GlobalTypeDef *USBx);
                                ^
In file included from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_conf.h:376:0,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal.h:48,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery.h:48,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery_audio.h:51,
                 from C:\Users\Games\Documents\Arduino\libraries\main/audio_conf.h:20,
                 from C:\Users\Games\AppData\Local\Temp\build1752890727166045145.tmp\audio_conf.c:28:
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_hcd.h:71:1: error: unknown type name 'USB_OTG_GlobalTypeDef'
 typedef USB_OTG_GlobalTypeDef   HCD_TypeDef;
 ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_hcd.h:86:3: error: unknown type name '__IO'
   __IO HCD_StateTypeDef     State;      /*!< HCD communication state  */
   ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal_hcd.h:86:29: error: expected ':', ',', ';', '}' or '__attribute__' before 'State'
   __IO HCD_StateTypeDef     State;      /*!< HCD communication state  */
                             ^
In file included from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery.h:48:0,
                 from C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery_audio.h:51,
                 from C:\Users\Games\Documents\Arduino\libraries\main/audio_conf.h:20,
                 from C:\Users\Games\AppData\Local\Temp\build1752890727166045145.tmp\audio_conf.c:28:
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4xx_hal.h:159:16: error: unknown type name '__IO'
 void HAL_Delay(__IO uint32_t Delay);
                ^
In file included from C:\Users\Games\Documents\Arduino\libraries\main/audio_conf.h:20:0,
                 from C:\Users\Games\AppData\Local\Temp\build1752890727166045145.tmp\audio_conf.c:28:
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery_audio.h:174:1: error: unknown type name '__IO'
 extern __IO uint16_t AudioInVolume;
 ^
C:\Users\Games\Documents\Arduino\libraries\main/stm32f4_discovery_audio.h:174:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'AudioInVolume'
 extern __IO uint16_t AudioInVolume;
                      ^
In file included from C:\Users\Games\Documents\Arduino\libraries\main/usbh_core.h:34:0,
                 from C:\Users\Games\Documents\Arduino\libraries\main/usbh_MIDI.h:32,
                 from C:\Users\Games\Documents\Arduino\libraries\main/main.h:34,
                 from C:\Users\Games\Documents\Arduino\libraries\main/random.h:18,
                 from C:\Users\Games\Documents\Arduino\libraries\main/soundGen.h:30,
                 from C:\Users\Games\Documents\Arduino\libraries\main/audio_conf.h:22,
                 from C:\Users\Games\AppData\Local\Temp\build1752890727166045145.tmp\audio_conf.c:28:
C:\Users\Games\Documents\Arduino\libraries\main/usbh_def.h:421:3: error: unknown type name '__IO'
   __IO uint8_t                      is_connected;    
   ^
C:\Users\Games\Documents\Arduino\libraries\main/usbh_def.h:421:37: error: expected ':', ',', ';', '}' or '__attribute__' before 'is_connected'
   __IO uint8_t                      is_connected;    
                                     ^
C:\Users\Games\Documents\Arduino\libraries\main/usbh_def.h:446:3: error: unknown type name '__IO'
   __IO HOST_StateTypeDef     gState;       /*  Host State Machine Value */
   ^
C:\Users\Games\Documents\Arduino\libraries\main/usbh_def.h:446:30: error: expected ':', ',', ';', '}' or '__attribute__' before 'gState'
   __IO HOST_StateTypeDef     gState;       /*  Host State Machine Value */
                              ^
Error compiling.


I understand this:

Code: Select all

audio_conf.h:20
It is telling me that in 'audio_conf.h' line 20 that something is not linked correctly.
However, I don't understand how I can go about fixing this:

Code: Select all

SPI_TypeDef                *Instance;    /* I2S registers base address        */

I would like to understand this all a bit more, as I am learning to program, and wish to have a deeper understanding of this aspect.
Maybe there is a better starting point than this, but I am finding it hard to locate information on how to do things such as this.
Another example of the process so that I may further my understanding would be appreciated.

Thanks in advance for any help!

User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Synth port attempt - A noob trying to port...

Post by RogerClark » Wed Aug 03, 2016 9:24 pm

It looks like the code you are trying to port is STM code that uses the STM HAL.

The HAL its self is hundreds of files that provide API functions to control the internal peripherals.

The Libmaple core does not use the HAL as its underpinning ( for historical licensing reasons)

Either try using the experimental HALMX core instead of the libmaple core ( see the repo in my github account)

Or remove references to the HAL from the library and rewrite calls to the HAL using Arduino API calls.

(Note, I did try to make the STM HAL into a library, but only very basic things work, because there is a big clash with the vector table use. So although you could try adding the hundreds of HAL files to your library , but I suspect it will be very difficult to get this working, and also it could be bloated with unused functions

stmNoob0xFF
Posts: 5
Joined: Mon Aug 01, 2016 2:23 pm

Re: Synth port attempt - A noob trying to port...

Post by stmNoob0xFF » Thu Aug 04, 2016 6:24 pm

Thanks for the reply.

I can make sense of what you have written, although some of it is over my head.

I'm looking for a solution / lib that handles MIDI over the USB OTG.
I'm a little bit lost though on how to initiate and get this working.
Are there any pointers that I could use?

Is this the repo you mentioned?:
https://github.com/rogerclarkmelbourne

I'm still interested in porting etc. Is there any code that would work that I can make practice of?

User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Synth port attempt - A noob trying to port...

Post by RogerClark » Thu Aug 04, 2016 9:12 pm

Various other people already have midi work on the STM32

There is a custom branch of the repo you linked to which allows you to select midi instead of USB serial

Please search the forum and read those postings

manoskav
Posts: 1
Joined: Wed Aug 10, 2016 4:30 pm

Re: Synth port attempt - A noob trying to port...

Post by manoskav » Sat Aug 13, 2016 3:02 pm

Hello,
I was aware in the past about this effort, of bringing arduino IDE and code into stm32 platforms. Recently, after acquiring my second nucleo board i thought that I would like to port the Arduino library to one of those (nucleo64 f411 and nucleo32 f301). Is there any guide in the forums that i could follow for the porting, or anything that can help? Sorry for posting it here but i didn't want to create a new thread.

User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Synth port attempt - A noob trying to port...

Post by RogerClark » Sat Aug 13, 2016 11:02 pm

Some F4 boards are supported but not midi on F4

If you are looking for general support of a different type of F4 board, take a look at the threads about HALMX core and also the core based on libopencm3.

For the F4 the HALMX core is better as it was originally developed for the F4 by @sheepdoll

madias
Posts: 813
Joined: Mon Apr 27, 2015 11:26 am
Location: Vienna, Austria

Re: Synth port attempt - A noob trying to port...

Post by madias » Mon Aug 15, 2016 9:07 pm

stmNoob0xFF wrote: I'm looking for a solution / lib that handles MIDI over the USB OTG.
What are your plans with MIDI and USB OTG?
For simple (or really complex!) Midi controller just grab a STM32F103xxx like maple mini clone (or blue pill) for USD3-4 and MIDI USB is running out of the box with this:
https://github.com/rogerclarkmelbourne/ ... addMidiHID
This is a video from a touch screen step sequencer demo I made with STM32duino a ILI9341 touch screen TFT and a maple mini clone:
https://www.youtube.com/watch?v=-jvCRHCk7wQ
I managed (nearly, but this is another story, not a technical) to get out a 4 voice polyphonic wavetable synth with a STM32F103RET6 board (was about 8USD). The RET6 "understands" 2x I2s so with ultra cheap audio DAC (80 cents or something) you get 4 voices out of one STM32.
So if you do not plan a super real time synth engine (or audio processing) with much floating points the "little brother" the F1 is also your friend.

Post Reply