Skip to content

Commit

Permalink
Pull request #10: DEE Demo Release 1.1.0
Browse files Browse the repository at this point in the history
Merge in MCU16CE/dspic33ck-curiosity-data-eeprom-emulation-demo from develop to master

* commit '038249012d82fc7e8fa06a7e2195db6c57e3281d':
  removed redundant information
  fixed typo
  Addressed review comments
  Added information regarding the DEE size constraint if hot swap is required
  Addressed review comments , added details to readme
  Addressed review comments
  Fixed typos
  Updated libraries to latest verions
  updated metadata
  Updated project
  Dual panel project added
  updated jenkinsfile
  • Loading branch information
harishagari committed Dec 18, 2023
2 parents 5fa710c + 0382490 commit aa52628
Show file tree
Hide file tree
Showing 88 changed files with 13,977 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .citd/Jenkinsfilek8s
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ pipeline {
MPLABX_PROJECT_SOURCE = "../"
}

triggers {
cron(env.BRANCH_NAME == 'develop' ? 'H H 1 * *': '')
}
options {
timestamps()
timeout(time: 20, unit: 'MINUTES')
Expand Down
4 changes: 2 additions & 2 deletions .main-meta/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"content": {
"metaDataVersion": "1.3.0",
"name": "com.microchip.mplabx.project.dspic33ck-curiosity-data-eeprom-emulation-demo",
"version": "1.0.1",
"version": "1.1.0",
"displayName": "dsPIC33CK Curiosity Data EEPROM Emulation Demo",
"projectName": "dspic33ck-curiosity-data-eeprom-emulation-demo",
"shortDescription": "dsPIC33CK Curiosity Data EEPROM Emulation Demo",
"ide": {
"name": "MPLABX",
"semverRange": ">=6.0.0"
"semverRange": ">=6.15.0"
},
"compiler": {
"name": "XC16",
Expand Down
57 changes: 42 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![image](images/microchip.jpg)
![image](images/microchip.jpg)

## dsPIC33CK Curiosity Data EEPROM Emulation Demo

Expand All @@ -10,23 +10,23 @@ Microchip Technology Inc., has expanded its product portfolio to include a wide
Many applications store nonvolatile information in the Flash program memory using table read and write operations. Applications that need to frequently update these data may have greater endurance requirements
than the specified Flash endurance for the MCU/Digital Signal Controller (DSC) devices.

The alternate solution of using an external, serial EEPROM device may not be appropriate for cost-sensitive or pin-constrained applications.
The alternate solution of using an external, serial EEPROM device may not be appropriate for cost-sensitive or pin-constrained applications.

This 16-Bit Data EEPROM Emulation library presents a third alternative that addresses these issues. This library features an interface similar to an internal data EEPROM, which
uses available program memory and can improve endurance by a factor as high as 500.

This code example demonstrate the usage of 16-Bit Data EEPROM Emulation Library.
This code example demonstrates the usage of 16-Bit Data EEPROM Emulation Library.

## Related Documentation

- dsPIC33CK256MP508 microcontroller (https://www.microchip.com/dsPIC33CK256MP508)
- Emulating Data EEPROM for PIC18 and PIC24 MCUs and dsPIC33 DSCs (https://www.microchip.com/en-us/application-notes/an1095)


## Software Used
## Software Used

- MPLAB® X IDE v6.00 or newer (https://www.microchip.com/mplabx)
- MPLAB® XC16 v2.00 or newer (https://www.microchip.com/xc)
- MPLAB® X IDE v6.15 or newer (https://www.microchip.com/mplabx)
- MPLAB® XC16 v2.00 or newer (https://www.microchip.com/xc)
- Any of the serial terminal application. Example: Tera Term (https://ttssh2.osdn.jp/index.html.en)
- 16-bit Data EEPROM Emulation Library (DEE) for PIC24 MCUs and dsPIC33 DSCs (https://www.microchip.com/en-us/software-library/16-bit_data_eeprom_emulation)

Expand All @@ -36,23 +36,50 @@ This code example demonstrate the usage of 16-Bit Data EEPROM Emulation Library.
- dsPIC33CK Curiosity Development Board (https://www.microchip.com/DM330030)
- Micro USB Cable


**Note:** The word panel and partition means the same thing and used interchangeably in this document.

## Operation
There are 2 examples in this repository. Example1 uses single panel and Example2 demonstrates dual panel capability of DEE.
Using dual panel is useful to not cause CPU execution stall during the normal runtime mode when the applications uses the DEE, which would be stored in the inactive partition.

This demo runs the Data EEPROM Emulation , if emulation is succesful then prints a message saying "Data EEPROM Emulation successful. Value at address 0 is 1024 and address1 is 1025"
If emulation fails it prints a message saying "Data EEPROM Emulation failed".
## Example1:
This demo runs the Data EEPROM Emulation , if emulation is successful then prints a message to the serial terminal saying "Data EEPROM Emulation successful. Value at address 0 is 1024 and address1 is 1025"
If emulation fails it prints a message to the serial terminal saying "Data EEPROM Emulation failed".

## Accessing 16-Bit Data EEPROM Emulation Library
## Example2:
There are 2 MPLABX projects under folder "dspic33ck-curiosity-dual-panel-dee-demo". One project for programming the first partition another for programming the second partition.

*Note:* More MCC Melody devices support will be added in future releases.
In a typical field scenario, boot-loader will help to do a live update i.e. boot-loader will help to download the new application to the secondary
partition and this new application will be configured such that on reboot, application in secondary partition will execute(secondary partition
becomes primary or active partition).

| Device Family | Procedure |
| ----------- | ----------- |
| "CK" Family of devices| 1. Create project <br> 2. Launch MCC <br> 3. Select "MCC Melody" <br> <img src="images/melodySelection.jpg" width="600"> <br> 4. "16-Bit Data EEPROM Emulation Library "will be available under "Libraries" <br> <img src="images/DEEMelody.jpg" width="600"> |
| All other devices except "CK" device family | 1. Make sure https://ww1.microchip.com/downloads/en/DeviceDoc/script-1.29.3.mc3lib is installed <br> 2. Create project <br> 3. Launch MCC <br> 4. Select "Classic MCC" <br> <img src="images/classicSelection.jpg" width="600"><br> 5. Switch core version to "5.2.1" <br> <img src="images/coreSwitch.jpg" width="600"> <br> 6. "16-Bit Data EEPROM Emulation Library" will be available under "Libraries" <br> <img src="images/DEEClassic.jpg" width="600"> |
If we want to program both the partitions of the microcontroller, MPLABX provides an option to create an unified hex file for programming both program memory partitions with different applications. In order to do that users have to configure one MPLABX project with XC16(Global Options) ->Partition as "Partition One/Active" and another MPLABX project with XC16(Global Options) ->Partition as "Partition Two/Inactive". Then second MPLABX project needs to be linked to first MPLABX project as loadable as shown below.

![image](images/projectConfig.jpg)

The projects in this example are already linked so that when dee-dual-panel-demo-partition1.X is built and programmed, it programs both the partitions.

After programming, the application in the first partition(active partition) will execute and DEE library will use the inactive partition(second partition) to store the DEE data. User will see the following data on the serial terminal on successful emulation,

![image](images/partition1.jpg)

After some time, once the emulation is completed and output is displayed, user has to reset the board. The application in the first partition, configures the configuration bits BSEQ and IBSEQ in the second partition, such that on reset second partition becomes the active partition. On resetting the board
application in the second partition will execute. DEE Library will check if there is any data available in the active partition from the previous iteration, if so it copies the data to the inactive partition(first partition), delete the previous iteration data from the active partition and continue with the emulation.

The following data will be displayed on successful emulation.

![image](images/partition2.jpg)

## Important Note
If there is no requirement for partition switching, the entire second partition(inactive partition) can be used for storing the DEE data. If partition switching is required make sure that free space in executable partition(active partition) is larger than the required DEE data structure size.

## Accessing 16-Bit Data EEPROM Emulation Library

*Note:* More MCC Melody devices support will be added in future releases.

| Device Family | Procedure |
| ----------- | ----------- |
| Devices supported on Melody| 1. Create project <br> 2. Launch MCC <br> 3. Select "MCC Melody" <br> <img src="images/melodySelection.jpg" width="600"> <br> 4. "16-Bit Data EEPROM Emulation Library "will be available under "Libraries" <br> <img src="images/DEEMelody.jpg" width="600"> |
| Devices not supported on Melody | 1. Make sure https://ww1.microchip.com/downloads/en/DeviceDoc/script-1.29.3.mc3lib is installed <br> 2. Create project <br> 3. Launch MCC <br> 4. Select "Classic MCC" <br> <img src="images/classicSelection.jpg" width="600"><br> 5. Switch core version to "5.2.1" <br> <img src="images/coreSwitch.jpg" width="600"> <br> 6. "16-Bit Data EEPROM Emulation Library" will be available under "Libraries" <br> <img src="images/DEEClassic.jpg" width="600"> |

For more information refer: https://www.microchip.com/en-us/software-library/dspic33-pic24-data-eeprom-emulation
13 changes: 10 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 16-Bit Data EEPROM Emulation Demo v1.1.0
### Release Highlights

Added an example project to demonstrate Dual Panel capability of Data EEPROM Emulation Library.

### Features Added\Updated

New example demonstrating dual panel capability of Data EEPROM Emulation Library is added.


# 16-Bit Data EEPROM Emulation Demo v1.0.1
### Release Highlights

Expand All @@ -10,6 +20,3 @@ Updated the demo to use the latest version of Melody
Initial release of 16-Bit Data EEPROM Emulation Demo

### Features Added\Updated



48 changes: 48 additions & 0 deletions dspic33ck-curiosity-dual-panel-dee-demo/.main-meta/main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"metaDataVersion": "1.0.0",
"category": "com.microchip.ide.project",
"content": {
"metaDataVersion": "1.3.0",
"name": "com.microchip.mplabx.project.dspic33ck-curiosity-dual-panel-data-eeprom-emulation-demo",
"version": "1.0.0",
"displayName": "dsPIC33CK Curiosity Dual Partition Flash Data EEPROM Emulation Demo",
"projectName": "dspic33ck-curiosity-dual-panel-data-eeprom-emulation-demo",
"shortDescription": "dsPIC33CK Curiosity Dual Partition Flash Data EEPROM Emulation Demo",
"ide": {
"name": "MPLABX",
"semverRange": ">=6.15.0"
},
"compiler": {
"name": "XC16",
"semverRange": "^2.0.0"
},
"dfp": {
"name": "dsPIC33CK-MP_DFP",
"semverRange": ">=1.6.176"
},
"configurator": {
"name": "MCC",
"semverRange": ">=5.1.1"
},
"device": {
"metaDataVersion": "1.0.0",
"category": "com.microchip.portal.contentRef",
"content": {
"metaDataVersion": "1.0.0",
"category": "com.microchip.device",
"name": "DSPIC33CK256MP508",
"versionRange": "*"
}
},
"peripherals": [
"UART",
"FLASH"
],
"keywords": [
"EEPROM",
"DEE",
"Data EEPROM Emulation",
"Dual Partition Flash"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL


# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib


# build
build: .build-post

.build-pre:
# Add your pre 'build' code here...

.build-post: .build-impl
# Add your post 'build' code here...


# clean
clean: .clean-post

.clean-pre:
# Add your pre 'clean' code here...
# WARNING: the IDE does not call this target since it takes a long time to
# simply run make. Instead, the IDE removes the configuration directories
# under build and dist directly without calling make.
# This target is left here so people can do a clean when running a clean
# outside the IDE.

.clean-post: .clean-impl
# Add your post 'clean' code here...


# clobber
clobber: .clobber-post

.clobber-pre:
# Add your pre 'clobber' code here...

.clobber-post: .clobber-impl
# Add your post 'clobber' code here...


# all
all: .all-post

.all-pre:
# Add your pre 'all' code here...

.all-post: .all-impl
# Add your post 'all' code here...


# help
help: .help-post

.help-pre:
# Add your pre 'help' code here...

.help-post: .help-impl
# Add your post 'help' code here...



# include project implementation makefile
include nbproject/Makefile-impl.mk

# include project make variables
include nbproject/Makefile-variables.mk
Loading

0 comments on commit aa52628

Please sign in to comment.