TOP Contributors

  1. MIKROE (2654 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136746 times)
  2. FAT32 Library (69953 times)
  3. Network Ethernet Library (55942 times)
  4. USB Device Library (46267 times)
  5. Network WiFi Library (41887 times)
  6. FT800 Library (41174 times)
  7. GSM click (28986 times)
  8. PID Library (26414 times)
  9. mikroSDK (26363 times)
  10. microSD click (25377 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Flash click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.16

mikroSDK Library: 2.0.0.0

Category: FLASH

Downloaded: 123 times

Not followed.

License: MIT license  

Flash Click is 8,388,608 bits (8 Mbit) on a Click board, organized into 1,048,576 bytes (1 MB). In other words, this Click board is a Flash memory medium with the capacity of 1 MB. The used Flash module has very good endurance and it can withstand up to 100,000 write cycles, with the data retention period of about 20 years.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Flash click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Flash click" changes.

Do you want to report abuse regarding "Flash click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


Flash click

Flash Click is 8,388,608 bits (8 Mbit) on a Click board, organized into 1,048,576 bytes (1 MB). In other words, this Click board is a Flash memory medium with the capacity of 1 MB. The used Flash module has very good endurance and it can withstand up to 100,000 write cycles, with the data retention period of about 20 years.

flash_click.png

click Product page


Click library

  • Author : Nemanja Medakovic
  • Date : Nov 2019.
  • Type : SPI type

Software Support

We provide a library for the Flash Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Flash Click driver.

Standard key functions :

  • Config Object Setup function.

    void flash_cfg_setup( flash_cfg_t *cfg );

  • Click Initialization function.

    flash_err_t flash_init( flash_t ctx, flash_cfg_t cfg );

  • Click Default Configuration function.

    void flash_default_cfg( flash_t *ctx );

Example key functions :

  • Page Write function.

    flash_err_t flash_write_page( flash_t ctx, uint32_t mem_addr, spi_master_data_t data_tx, uint16_t n_data );

  • Page Read function.

    flash_err_t flash_read_page( flash_t ctx, uint32_t mem_addr, spi_master_data_t data_rx, uint16_t n_data );

  • Sector Erase function.

    flash_err_t flash_erase_sector( flash_t *ctx, uint32_t mem_addr );

Examples Description

This example demonstrates the use (control) of the FLASH memory.

The demo application is composed of two sections :

Application Init

Initializes all necessary peripherals and pins used by Flash click and also initializes uart logger to show results.


void application_init( void )
{
    flash_cfg_t flash_cfg;
    log_cfg_t log_cfg;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.
    flash_cfg_setup( &flash_cfg );
    FLASH_MAP_MIKROBUS( flash_cfg, MIKROBUS_1 );
    flash_init( &flash, &flash_cfg );

    //  Click reset and default configuration.
    flash_reset( &flash );
    flash_default_cfg( &flash );

    log_printf( &logger, "***  Flash Initialization Done.  ***\r\n" );
    log_printf( &logger, "************************************\r\n" );
}

Application Task

Executes memory data writing, reading from the memory to verify data writing operation and sector erasing to clear memory.


void application_task( void )
{
    enter_data( "Mikroelektronika (MikroE)" );

    log_printf( &logger, "> Data content to be written: %s\r\n", data_buf );
    log_printf( &logger, "> Data writing to memory...\r\n" );
    flash_write_page( &flash, FLASH_MEM_ADDR_FIRST_PAGE_START, data_buf, n_data );
    log_printf( &logger, "> Done.\r\n" );

    memset( data_buf, 0, sizeof( data_buf ) );
    process_wait( );

    log_printf( &logger, "> Data reading from memory...\r\n" );
    flash_read_page( &flash, FLASH_MEM_ADDR_FIRST_PAGE_START, data_buf, n_data );
    log_printf( &logger, "> Done.\r\n> Read data content: %s\r\n", data_buf );

    process_wait( );

    log_printf( &logger, "> Sector erasing...\r\n" );
    flash_erase_sector( &flash, FLASH_MEM_ADDR_FIRST_SECTOR_START );
    log_printf( &logger, "> Done.\r\n" );

    process_wait( );
}

Additional Functions

  • Enter Data / Allows user to enter a desired data.
  • Process Wait / Makes a delay to wait while some process be done.

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Flash

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


ALSO FROM THIS AUTHOR

Heart rate 3 click

0

Heart rate 3 click is a mikroBUS add-on board whose functionality is determined by two components: an OSRAM’s SFH7050 pulse oximetry and heart rate monitoring module, and a TI AFE4404 (analong-front-end) IC specialized for bio-sensing.

[Learn More]

SPIRIT 2 click

0

SPIRIT 2 Click features the SP1ML-915, an ultra-low power, fully integrated RF module, which operates at 915 MHz ISM band. This Click board™ can be used to add wireless connectivity to any application, requiring no extensive RF communication experience. The module integrates all the required components, including the 32-bit STM32L1 MCU, a compact chip antenna, and accompanying circuitry. The SP1ML-915 module supports several types of modulation schemes, including 2-FSK, GFSK, GMSK, OOK, and ASK, allowing it to fulfill different RF transmission requirements.

[Learn More]

ADC 8 click

0

ADC 8 Click is a high precision, low-power, 16-bit analog-to-digital converter (ADC), based around the ADS1115 IC.

[Learn More]