TM-Subsystem / SD-Card / STM32F0 / unknown type name 'halrtc

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

Moderators: barthess, RoccoMarco

Ramazzukk
Posts: 25
Joined: Sun Jan 06, 2013 2:19 pm
Location: Switzerland

TM-Subsystem / SD-Card / STM32F0 / unknown type name 'halrtc

Postby Ramazzukk » Sat May 03, 2014 6:41 am

Hi there,

I am trying to use a SD-Card / FatFS with the STM32F0-Discovery-Board. Since there is no demo, I copied the relevant Code from the F107 Olimex demo. Part of the code is working (I can read at least the filenames from the card), but I don't understand the usage of the TM subsystem.

If I activate the TM subsystem at halconf (like it is in the F107-demo), the compiler gives me an error: unknown type name 'halrtcnt_t'. I compared the makefiles and conffiles an can not figure out what i'm missing.

I guess the TM subsystem is needed for this:

Code: Select all

static void tmrfunc(void *p) {
  BaseBlockDevice *bbdp = p;

  chSysLockFromIsr()
  ;
  if (cnt > 0) {
    if (blkIsInserted(bbdp)) {
      if (--cnt == 0) {
        chEvtBroadcastI(&inserted_event);
      }
    }
    else
      cnt = POLLING_INTERVAL;
  }
  else {
    if (!blkIsInserted(bbdp)) {
      cnt = POLLING_INTERVAL;
      chEvtBroadcastI(&removed_event);
    }
  }
  chVTSetI(&tmr, MS2ST(POLLING_DELAY), tmrfunc, bbdp);
  chSysUnlockFromIsr();
}


Do I have to switch on another part (mcuconf or somewhere)? Any guidance is greatly appreciated beforehand!

User avatar
Giovanni
Site Admin
Posts: 13086
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 759 times
Been thanked: 637 times
Contact:

Re: TM-Subsystem / SD-Card / STM32F0 / unknown type name 'ha

Postby Giovanni » Sat May 03, 2014 8:16 am

The TM subsystem is not supported on the M0 CPUs because they lack the RT counter register.

Anyway, it is not needed in your case, that code uses virtual timers which are unrelated to TM.

Giovanni

Ramazzukk
Posts: 25
Joined: Sun Jan 06, 2013 2:19 pm
Location: Switzerland

Re: TM-Subsystem / SD-Card / STM32F0 / unknown type name 'ha

Postby Ramazzukk » Sat May 03, 2014 10:52 am

Hi Giovanni

Thank you very much for your quick response!

Ramazzukk
Posts: 25
Joined: Sun Jan 06, 2013 2:19 pm
Location: Switzerland

Re: TM-Subsystem / SD-Card / STM32F0 / unknown type name 'ha

Postby Ramazzukk » Sun May 04, 2014 5:04 pm

Hi there again,

Maybe its very simple, but im struggling to understand following section:

Code: Select all

static void tmrfunc(void *p) {
  BaseBlockDevice *bbdp = p;

  chSysLockFromIsr();

  if (cnt > 0) {
    if (blkIsInserted(bbdp)) {
      if (--cnt == 0) {
        chEvtBroadcastI(&inserted_event);
      }
    }
    else
      cnt = POLLING_INTERVAL;
  }
  else {
    if (!blkIsInserted(bbdp)) {
      cnt = POLLING_INTERVAL;
      chEvtBroadcastI(&removed_event);
    }
  }
  chVTSetI(&tmr, MS2ST(POLLING_DELAY), tmrfunc, bbdp);
  chSysUnlockFromIsr();
}


In IOBlock.h is

Code: Select all

#define blkIsInserted(ip) ((ip)->vmt->is_inserted(ip)).


Then Eclipse points me to three different directions: ioblock.h, mmc_spi.h, mmcsd.h..

How ist blkIsInserted(bbdp) becoming true? I can't figure out..

Thank you for any further guidance..

User avatar
Giovanni
Site Admin
Posts: 13086
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 759 times
Been thanked: 637 times
Contact:

Re: TM-Subsystem / SD-Card / STM32F0 / unknown type name 'ha

Postby Giovanni » Sun May 04, 2014 6:01 pm

Hi,

That macro ultimately calls a function in board.c, the detection method for cards is board-dependent. you need to make sure that your board.c implements that function.

Giovanni

Ramazzukk
Posts: 25
Joined: Sun Jan 06, 2013 2:19 pm
Location: Switzerland

Re: TM-Subsystem / SD-Card / STM32F0 / unknown type name 'ha

Postby Ramazzukk » Sun May 04, 2014 7:45 pm

Hi Giovanni,

Thank you for your reply. I've found it now:

Code: Select all

#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
/**
 * @brief   MMC_SPI card detection.
 */
bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) {

  (void)mmcp;
  /* TODO: Fill the implementation.*/
  return TRUE;
}

User avatar
Giovanni
Site Admin
Posts: 13086
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 759 times
Been thanked: 637 times
Contact:

Re: TM-Subsystem / SD-Card / STM32F0 / unknown type name 'ha

Postby Giovanni » Sun May 04, 2014 8:08 pm

Yes, that one.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 2 guests