[libmaple] Black F407VET6

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
acronis
Posts: 107
Joined: Thu Mar 02, 2017 12:32 pm

Re: [libmaple] Black F407VET6

Post by acronis » Tue Jul 04, 2017 8:17 am

Hello.

Your library on the STM32F407VET6 wonderful ! Now I work and display and SD CARD (SDIO)!!!

But I can not deal with the internal rtc for this Board.
Please give a simple working example for this Board.

I really need time and date for the my project.

stevestrong
Posts: 1502
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] Black F407VET6

Post by stevestrong » Tue Jul 04, 2017 8:29 am

I did not deal with RTC yet, but it may be my next target as the black F4 board has the cell battery on-board.

You could check this library already in the repository:
https://github.com/rogerclarkmelbourne/ ... es/RTClock

Some examples can be found here:
https://github.com/rogerclarkmelbourne/ ... k/examples

acronis
Posts: 107
Joined: Thu Mar 02, 2017 12:32 pm

Re: [libmaple] Black F407VET6

Post by acronis » Tue Jul 04, 2017 8:44 am

Great !
I will wait for your news about the black F4 RTC Board battery on Board.

library already in the repository, and I'll try to check.

stevestrong
Posts: 1502
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] Black F407VET6

Post by stevestrong » Tue Jul 04, 2017 5:44 pm

Meanwhile I deleted the generic_F4 branch, so that the master branch will have the latest developments. I updated the first post, too.

vitor_boss
Posts: 61
Joined: Wed Apr 19, 2017 9:50 am

Re: [libmaple] Black F407VET6

Post by vitor_boss » Thu Jul 06, 2017 5:17 am

To enable FPU need few things. Insert this on Start_c.c

Code: Select all

#if (__ARM_PCS==1 || __ARM_PCS_VFP==1) //using FP on code?
  #if defined (__FP_FAST_FMAF) //mfloat-abi=hard or mfloat-abi=softfp
    #warning enabling harware fpu
    __asm volatile
    (
      "  ldr.w r0, =0xE000ED88    \n"  /* The FPU enable bits are in the CPACR. */
      "  ldr r1, [r0]             \n"  /* read CAPCR */
      "  orr r1, r1, #( 0xf << 20 )\n" /* Set bits 20-23 to enable CP10 and CP11 coprocessors */
      "  str r1, [r0]              \n" /* Write back the modified value to the CPACR */
      "  dsb                       \n" /* wait for store to complete */
      "  isb"                          /* reset pipeline now the FPU is enabled */
    );
  #else
    #warning software or no floating point 
  #endif
#endif
And this on boards.txt

Code: Select all

generic_f407v.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
generic_f407v.build.extra_flags=-mthumb -DSTM32_HIGH_DENSITY -DSTM32F4 -DBOARD_generic_f407v -D__FPU_PRESENT=1
On my tests with FPU the math is 3x faster

vitor_boss
Posts: 61
Joined: Wed Apr 19, 2017 9:50 am

Re: [libmaple] Black F407VET6

Post by vitor_boss » Thu Jul 06, 2017 5:42 am

There is a macro missing from arduino Word(h,l);
Just insert those lines on wirish_math.h on line 36

Code: Select all

#include <stdint.h>
and those at 152

Code: Select all

uint16_t makeWord(uint16_t w);
uint16_t makeWord(uint8_t h, uint8_t l);

#define word(...) makeWord(__VA_ARGS__)
and this at the end of wirish_math.cpp:

Code: Select all

extern uint16_t makeWord( uint16_t w ) { return w ; }

extern uint16_t makeWord( uint8_t h, uint8_t l ) { return (h << 8) | l ; }
Thank you
Last edited by vitor_boss on Fri Jul 07, 2017 1:30 am, edited 1 time in total.

acronis
Posts: 107
Joined: Thu Mar 02, 2017 12:32 pm

Re: [libmaple] Black F407VET6

Post by acronis » Thu Jul 06, 2017 9:03 am

Hello.
Can you show an example for the RTC in your library

If I connect the library #include <RTClock.h> error
The maintainer is missing from libraries C:\Users\Admin\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\RTClock

vitor_boss
Posts: 61
Joined: Wed Apr 19, 2017 9:50 am

Re: [libmaple] Black F407VET6

Post by vitor_boss » Fri Jul 07, 2017 1:36 am

https://github.com/Marzogh/SPIFlash
This lib works on STM32GENERIC, with yours I'm getting no lucky.

EDIT: Default EEPROM is W25Q16, I have to replace mine because was return wrong numbers, now is W25Q64.

stevestrong
Posts: 1502
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] Black F407VET6

Post by stevestrong » Mon Jul 10, 2017 5:15 pm

First post updated with following info:

EDIT - 2017.07.10
RTC lib reworked to be independent from other time libraries. Tested on balck F4V board. Includes an example sketch to set the RTC time.

acronis
Posts: 107
Joined: Thu Mar 02, 2017 12:32 pm

Re: [libmaple] Black F407VET6

Post by acronis » Tue Jul 11, 2017 6:29 am

I added to the end of the file library.properties string maintainer= and the error is Missing 'maintainer' from the library disappeared. The library has connected fine.
Whether it is possible to add to Your library ?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests