• AVR Freaks

NVRAM - tutorial?

Author
grambo
Elite code monkey
  • Total Posts : 94
  • Reward points : 0
  • Joined: 2017/01/04 11:38:49
  • Location: near Tucson AZ, USA
  • Status: offline
2017/02/01 07:51:01 (permalink)
0

NVRAM - tutorial?

(original post here: http://www.microchip.com/forums/m971278.aspx)
 
I'm trying to find a starting point for using the NVRAM in Harmony 1.09 for a PIC32MX270F256D.   The "drv_nvm_static_local.h" that's being generated only has unlock, erase, write and a rather obscure "_DRV_NVM_BlockOperation" as functions presented to the outside world.  In the "drv_nvm_static.c", there is an internal function "DRV_NVM_Read" which looks like what I should be using to read the NVRAM, but it's not exposed in the .h file.  
Should I...
  • extrern the "DRV_NVM_Read()" so I can use it?
  • crawl thru the "_DRV_NVM_BlockOperation()" and learn to use it?
  • scrap the Harmony part of this and use some old school PLIB calls?
Quick history on myself, I haven't written embedded C in about 2 or 3 years, but I've completed a dozen or so projects with PIC's over the years (mostly PIC24H's).  I started to use Harmony 2.0 and uninstalled it after a couple weeks (I'll try not to rant about that here), dropped back to 1.09 and seem to be using it for initialization/configuration, but I can't deal with the bloat of the runtime calls.  (my UART was around 2.3usec/char with Harmony, now it's around 1.3us on the bare metal PLIB calls) 
 
snippet from "drv_nvm_static_local.h":
/****************************************
* Local functions
*****************************************/
void _DRV_NVM_UnlockSequence (_DRV_NVM_OPERATION_MODE mode);
void _DRV_NVM_WriteBufferObjProcess(DRV_NVM_BUFFER_OBJECT * bufferObj);
void _DRV_NVM_EraseBufferObjProcess(DRV_NVM_BUFFER_OBJECT * bufferObj);
DRV_NVM_COMMAND_HANDLE _DRV_NVM_BlockOperation (uint8_t * sourceBuffer, uint32_t blockStart,
uint32_t nBlock, DRV_NVM_BUFFER_FLAGS flag,
uint32_t blockSize);
#1
Jump to:
© 2020 APG vNext Commercial Version 4.5