Author Topic: Compile for STM32F746 fail  (Read 23753 times)

Offline LuisHS

  • Newbie
  • *
  • Posts: 32
    • View Profile
Compile for STM32F746 fail
« on: June 08, 2019, 02:31:19 PM »
 
Hello Mark.

I have run STM32F746 version with Coocox, but when I compile, fail with one error.
How can I solve please ?

Attached capture screen with the error.
\Applications\uTaskerV1.4/debug.c:2778: undefined reference to `fnUpTime'
collect2.exe: error: ld returned 1 exit status


How can I configure for bootloader with SD card and STM32F746 ?


Best Regards

« Last Edit: June 08, 2019, 02:41:22 PM by LuisHS »

Offline LuisHS

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Compile for STM32F746 fail
« Reply #1 on: June 08, 2019, 02:54:43 PM »

I have open and compile de uTaskerSerialBoot, this do not fail when compile, but in config.h is not the F746 available.

How can I configure uTasker to work with SD bootloader with STM32F746 ?

Thanks.


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: Compile for STM32F746 fail
« Reply #2 on: June 09, 2019, 10:51:14 PM »
Hi

Which version of the project are you using?

CooCox hasn't been used for some time due to the fact that the IDE doesn't really exist any more. I have V2.0.5 still installed and can build the project for Kinetis parts if I change iic_drv.c to i2c_drv.c in the project files.
fnUpTime() is in the file time_keeper.c -if you have an old version it may be that timer_keeper.c hasn't been added to the CooCox project setup and you can do this by adding the file (that should exist in the /uTasker folder to the CooCox CoIDE project files.

In the lasted uTaskerV1.4 project configuration the target NUCLEO_F746ZG has been foreseen but hasn't been configured - STM32F746G_DISCO can be used but has only basic support at the HW library level but utFAt and the SD card HW interface is available.

There was no STM32F746G_DISCO target for the serial loader but new targets can be quite easy added if there is a reference target in the main (uTaskerV1.4) project. For example, i just added the target to my version as follows:

1. Add the new target in config.h
#define STM32F746G_DISCO                                           // evaluation board with STM32F746NGH6
2. Add its main properties in the same file:
Code: [Select]
#elif defined STM32F746G_DISCO
    #define TARGET_HW            "STM32F746-Discovery"
    #define _STM32F7XX
    #define _STM32F746
    #define OUR_HEAP_SIZE        (HEAP_REQUIREMENTS)((24 * 1024) * MEM_FACTOR) // we have the LAN buffers in HEAP and big RX/TX
3. Add a processor configuration in app_hw_stm32.h
#elif defined STM32F746G_DISCO                                           // STM32F746NGH6 (216MHz)
    #define CRYSTAL_FREQ        25000000
  //#define DISABLE_PLL                                                  // run from clock source directly
  //#define USE_HSI_CLOCK                                                // use internal HSI clock source
    #define PLL_INPUT_DIV       25                                       // 2..64 - should set the input to pll in the range 1..2MHz (with preference near to 2MHz)
    #define PLL_VCO_MUL         336                                      // 64 ..432 where VCO must be 64..432MHz
    #define PLL_POST_DIVIDE     2                                        // post divide VCO by 2, 4, 6, or 8 to get the system clock speed
    #define PIN_COUNT           PIN_COUNT_216_PIN
    #define PACKAGE_TYPE        PACKAGE_BGA
    #define SIZE_OF_RAM         (320 * 1024)                             // 320k SRAM (DTCM + SRAM1 + SRAM2)
    #define SIZE_OF_FLASH       (1024 * 1024)                            // 1M FLASH
    #define SUPPLY_VOLTAGE      SUPPLY_2_7__3_6                          // power supply is in the range 2.7V..3.6V
    #define PCLK1_DIVIDE        4
    #define PCLK2_DIVIDE        2
    #define HCLK_DIVIDE         1

4. Add the board configuration too:
#elif defined STM32F746G_DISCO
    #define USER_KEY_BUTTON            PORTI_BIT11

    #define LED1                       PORTI_BIT1                        // green LED
    #define LED2                       PORTI_BIT2                        // no further LEDs available on the board
    #define LED3                       PORTI_BIT3
    #define LED4                       PORTI_BIT4

    #define BLINK_LED                  LED1

    #define INIT_WATCHDOG_LED()        _CONFIG_PORT_OUTPUT(I, BLINK_LED, (OUTPUT_SLOW | OUTPUT_PUSH_PULL))
    #define TOGGLE_WATCHDOG_LED()      _TOGGLE_PORT(I, BLINK_LED)        // blink the LED, if set as output

    #define INIT_WATCHDOG_DISABLE()
    #define WATCHDOG_DISABLE()         0

    #define FORCE_BOOT()               (_READ_PORT_MASK(I, (USER_KEY_BUTTON))) // hold user key at reset to force boot loader mode

    // LEDs
    //
                                       // '0'            '1'        input state  center (x,   y)  0 = circle, radius, controlling port, controlling pin
    #define KEYPAD_LED_DEFINITIONS     {RGB(50, 50, 50), RGB(0, 255, 0), 0, {14, 163, 27, 168}, _PORTI, LED1}

    #define BUTTON_KEY_DEFINITIONS     {_PORTI, USER_KEY_BUTTON, {16, 235, 31, 250}}

    #define KEYPAD "../../uTaskerV1.4/Simulator/KeyPads/STM32F746-DISC.bmp"

    // Power down the USB controller and disable interrupts before jumping to the application
    //
    #define RESET_PERIPHERALS()        IRQ0_31_CER  = 0xffffffff; \
                                       IRQ32_63_CER = 0xffffffff; \
                                       IRQ64_95_CER = 0xffffffff; \
                                       IRQ0_31_CPR  = 0xffffffff; \
                                       IRQ32_63_CPR = 0xffffffff; \
                                       IRQ64_95_CPR = 0xffffffff; \
                                       POWER_DOWN(AHB2, RCC_AHB2ENR_OTGFSEN); \
                                       POWER_DOWN(APB2, RCC_APB2ENR_SYSCFGEN); \
                                       SDIO_POWER = SDIO_POWER_POWER_OFF;

5. For SD card operation share the setup with other boards alreadiy using the SD card controller:
    #if defined STM3240G_EVAL || defined ST_MB997A_DISCOVERY || defined STM32F746G_DISCO
        #define SD_CONTROLLER_AVAILABLE                                  // use SDIO rather than SPI (necessary on STM3240G-EVAL board)


Regards

Mark





Offline LuisHS

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Compile for STM32F746 fail
« Reply #3 on: June 11, 2019, 01:44:31 AM »
Hello Mark, thanks for your reply.
Im confused, several versions, but most fail when I try to compile.

What version I must use for a Bootloader by SD, with the STM32F746 ?


I have open the STM32_uTaskerV1.4.9_pre_20.12.2016. I load the three Applications and I compile.
uTaskerboot --------> fail (debug.c:2778: undefined reference to `fnUpTime')
uTaskerSerialBoot --> fail (debug.c:2778: undefined reference to `fnUpTime')
uTaskerV1.4 --> This compile.

What of the three I must use for a Bootloader by SD for a STM32F746 ?





« Last Edit: June 11, 2019, 01:57:41 AM by LuisHS »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: Compile for STM32F746 fail
« Reply #4 on: June 11, 2019, 01:50:54 AM »
Hi

Are you using the open source version on GITHUB or the professional version?

Regards

Mark

Offline LuisHS

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Compile for STM32F746 fail
« Reply #5 on: June 11, 2019, 01:58:28 AM »
Hi

Are you using the open source version on GITHUB or the professional version?

Regards

Mark


I do not understand what do you mean, I work with the sources STM32_uTaskerV1.4.9_pre_20.12.2016
Only the uTaskerV1.4 compile, but Im not sure if this is for STM32F746 bootloader by SD

Offline LuisHS

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Compile for STM32F746 fail
« Reply #6 on: June 11, 2019, 02:04:47 AM »

Now I have open the uTaskerV1.4.3_STM32, and this compile but there is nothing for the F746

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: Compile for STM32F746 fail
« Reply #7 on: June 11, 2019, 01:11:31 PM »
Hi

These versions are quite old and some don't have STM32F7xx support in them.

The latest Open Source version of the project is on GIT HUB:
https://github.com/uTasker/uTasker-Kinetis
and allows developing projects that run on both STM32 and Kinetis parts.

To build the serial loader for STM32F746G_DISCO use the "uTaskerSerialBoot" project and not the "uTaskerV1.4" project, where I have just checked in the STM32F746G_DISCO configuration.

Good luck

Regards

Mark


Offline LuisHS

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Compile for STM32F746 fail
« Reply #8 on: June 12, 2019, 12:07:24 AM »

Ok, thank you Marc.
Are you planning to add NXP RT1020?

« Last Edit: June 12, 2019, 12:08:55 AM by LuisHS »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: Compile for STM32F746 fail
« Reply #9 on: June 12, 2019, 02:03:21 PM »
Hi

Yes, i.MX RT 1020 is in preparation.

To a previous question:

- debug.c is not a file used by either the uTaskerboot nor uTaskerSerialBoot, which means that the projects must be trying to use the wrong files.
- the project uTaskerSerialBoot includes a mode to load from the SD card[/b]

Regards

Mark

Offline LuisHS

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Compile for STM32F746 fail
« Reply #10 on: June 13, 2019, 10:34:06 PM »

ok, thanks.
I have replace _KINETIS by _STM32 and enable the define for the STM32F746, but there is none app_hw_stm32.h file to add the rest of parameters that you said in before post.



« Last Edit: June 13, 2019, 10:53:31 PM by LuisHS »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: Compile for STM32F746 fail
« Reply #11 on: June 13, 2019, 10:46:12 PM »
Hi

If using CooCox you need to open up the configuration and change the pre-processor define accordingly. For STM32 change _KINETIS to _STM32. Also change the linker script file to use the correct STM32 linker script file.

There are otherwise two separate IAR uTaskerSerialLoader projects - one for STM32 and one for KINETIS.

There are also two serarate GNU folders (with make files and liker scripts) for the two different processor families

Regards

Mark

Offline LuisHS

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Compile for STM32F746 fail
« Reply #12 on: June 13, 2019, 10:54:07 PM »
Yes, I saw, thanks.

I have replace _KINETIS by _STM32 and enable the define for the STM32F746G_DISCO, but there is none app_hw_stm32.h file to add the rest of parameters that you said in before post.

Offline LuisHS

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Compile for STM32F746 fail
« Reply #13 on: June 13, 2019, 11:21:12 PM »
 
I have add manually the app_hw_stm32.h file to the project, but though I have enable the define STM32F746G_DISCO, when I go to the app_hw_stm32.h, all the instructions for STM32F746G_DISCO are disabled.

I have closed and reopened the project, but they are always disabled.

« Last Edit: June 13, 2019, 11:26:18 PM by LuisHS »

Offline LuisHS

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Compile for STM32F746 fail
« Reply #14 on: June 14, 2019, 09:26:45 PM »

5. For SD card operation share the setup with other boards alreadiy using the SD card controller:
    #if defined STM3240G_EVAL || defined ST_MB997A_DISCOVERY || defined STM32F746G_DISCO
        #define SD_CONTROLLER_AVAILABLE                                  // use SDIO rather than SPI (necessary on STM3240G-EVAL board)



For this option, seem I need define also SDCARD_SUPPORT in config.h.
I must to do it here ??

Code: [Select]
#if !defined TWR_K20D50M && !defined FRDM_K20D50M && !defined FRDM_KL46Z && !defined FRDM_KL43Z && !defined TWR_KL46Z48M && !defined FRDM_KL26Z && !defined FRDM_KL27Z && !defined TWR_KL25Z48M && !defined FRDM_KL02Z && !defined FRDM_KL03Z && !defined FRDM_KL05Z && !defined FRDM_KE02Z && !defined FRDM_KE02Z40M && !defined FRDM_KE04Z && !defined TWR_K20D72M && !defined TWR_K21D50M && !defined TWR_K22F120M && !defined TWR_K24F120M && !defined K24FN1M0_120 && !defined FRDM_K22F && !defined TWR_KV10Z32 && !defined TWR_KV31F120M && !defined K66FX1M0 // boards have no SD card socket
  //#define SDCARD_SUPPORT                                               // SD-card interface (only choose one of these options at a time)
  //#define SPI_FLASH_FAT                                                // SPI flash
        #define SIMPLE_FLASH                                             // don't perform block management and wear-levelling
        #define FLASH_FAT_MANAGEMENT_ADDRESS     (SIZE_OF_FLASH)
  //#define DELETE_SDCARD_FILE_AFTER_UPDATE


I must enable only one of the four options ?
Now there are enable two options

Code: [Select]
  //#define SDCARD_SUPPORT                                               // SD-card interface (only choose one of these options at a time)
  //#define SPI_FLASH_FAT                                                // SPI flash
    #define SIMPLE_FLASH                                             // don't perform block management and wear-levelling
    #define FLASH_FAT_MANAGEMENT_ADDRESS     (SIZE_OF_FLASH)




« Last Edit: June 14, 2019, 09:29:42 PM by LuisHS »