• AVR Freaks

Hot!CEC1x02 Development Board - First Steps

Author
joaomorenorf
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2021/01/14 13:18:37
  • Location: 0
  • Status: offline
2021/01/14 20:47:24 (permalink)
0

CEC1x02 Development Board - First Steps

Hi everybody,

I'm trying to use DM990013 - CEC1x02 Development Board with CEC1702 microcontroller, but I'm having trouble with initial setup.

I read the datasheet and I'm aware of programming eFuse. I don't know how, the datasheet covers only Clicker Boards and I'm using Microchip default board with PICkit 4.

How can I do this procedure? I've already generated eFuse binary, but I don't know how to upload it to device.

After that, how can I insert my firmware signing keys to MPLAB X?

My setup:
DM990013 - CEC1x02 Development Board
MPLAB PICkit 4 In-Circuit Debugger
MPLAB X IDE v5.45
Debian 10.7

Thanks in advance,

Joao
post edited by joaomorenorf - 2021/01/20 03:00:02
#1

4 Replies Related Threads

    sen
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2017/11/22 01:59:08
    • Location: 0
    • Status: offline
    Re: CEC1x02 Development Board - First Steps 2021/01/25 05:02:57 (permalink)
    0
    Hi,
     
    did you get anywhere with this? I bought this board hoping I could get something working without reading the datasheet :(
     
    The CEC1702 family of devices offer a software development system interface that includes a Trace FIFO Debug port and a JTAG/SWD debug interface.
     
    1.2 Boot ROM Following the release of the RESET_EC signal, the processor will start executing code in the Boot ROM. The Boot ROM executes the SPI Flash Loader, which downloads User Code from an external SPI Flash and stores it in the internal Code RAM. Upon completion, the Boot ROM jumps into the User Code and starts executing as defined in the CEC1702 ROM Description Addendum. The Boot ROM loads code from an external SPI Flash device. The interface supports SPI devices with dual and quad data rates, in addition to standard SPI devices. The downloaded code must configure the device’s pins according to the platform’s needs. After loading code, the Boot ROM leaves all pins in their default initial state.
     
    ...I don't know if you can use a picKit4 to program the cec1702?
     
    Unrelated to your specific question - but related to the thread title...
     
    For info anyone trying to use an ICD4 I needed these:
    https://microchipdeveloper.com/icd4:interface-pinouts
    https://microchipdeveloper.com/icd4:connecting-rj-11-cable-to-rj-45-socket 
     
    There are efuse programming guides (using an IDC4) inside the Azure iot SDKs:
    https://www.microchip.com/DevelopmentTools/ProductDetails/DM990013-BNDL
     
    I am stuck getting the dice riot sdk project working. Have done all the azure provisioning/setup and bodged a 'special' header to make it compile. But when I debug and listen using ComEDBG I get the following response...
     
    [11:47:54.476] [nmi spi]: Failed cmd response read...(ff)
    [11:47:54.476] [nmi spi]: Failed cmd response, read reg (0000e824)...
    [11:47:54.476] [nmi spi]: Failed internal read protocol with CRC on, retyring with CRC off...
    [11:47:54.476] [nmi spi]: Failed cmd response read...(ff)
    [11:47:54.476] [nmi spi]: Failed cmd response, read reg (0000e824)...
    [11:47:54.476] [nmi spi]: Failed internal read protocol...
     
    Think it can't connect to wifi - anyone have any ideas?
     
    Cheers
     
    Seb
     
    #2
    joaomorenorf
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2021/01/14 13:18:37
    • Location: 0
    • Status: offline
    Re: CEC1x02 Development Board - First Steps 2021/01/25 06:36:15 (permalink)
    0
    Hi Seb,
    I think It's possible to program CEC1702 with PICkit4, because this is written at PICkit4 datasheet:
     
    The MPLAB PICkit 4 programs faster than its predecessor and comes ready to support
    PIC, dsPIC and CEC MCU devices.
     
    By the end of the week I'll be able to check out Asure's IoT documentation and try to test the same programming technique used by ICD4, hope it works, thanks.
     
    About using WiFi with DM990013, I don't have the WiFi module, but, if my kit flashes any program, I'll flash dice riot sdk project and I'll let you know what it outputs. Probably it will be the same error, because I'll not have any device connected to the board, who knows?
     
    Best regards,
     
    Joao
    #3
    joaomorenorf
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2021/01/14 13:18:37
    • Location: 0
    • Status: offline
    Re: CEC1x02 Development Board - First Steps 2021/01/29 07:04:24 (permalink)
    0
    Hello again,
    I've followed efuse programming guides from azure docs as you suggested. At some point I really thought it would work, but when I press "run" after setting PC to 0xE0348 the microcontroller arrives at address 0xE0486. This address has the instruction: B.N. 0xE0486, so I just get stuck there. Do you know what happened?

    I tried to flash dice riot sdk project and it didn't even compiled.


     
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c: In function 'gpio_irq_enable':
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:42:43: error: 'INTS_BASE' undeclared (first use in this function)
         (volatile struct GPIO_GIRQ_REGISTER*)(INTS_BASE + GPIO_GIRQ_X_OFFSET(pin))
                                               ^
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:46:6: note: in expansion of macro 'GPIO_GIRQ'
         (GPIO_GIRQ(pin))->GIRQ_SRC    = GPIO_GIRQ_BITMSK(pin);
          ^~~~~~~~~
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:42:43: note: each undeclared identifier is reported only once for each function it appears in
         (volatile struct GPIO_GIRQ_REGISTER*)(INTS_BASE + GPIO_GIRQ_X_OFFSET(pin))
                                               ^
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:46:6: note: in expansion of macro 'GPIO_GIRQ'
         (GPIO_GIRQ(pin))->GIRQ_SRC    = GPIO_GIRQ_BITMSK(pin);
          ^~~~~~~~~
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c: In function 'gpio_irq_disable':
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:42:43: error: 'INTS_BASE' undeclared (first use in this function)
         (volatile struct GPIO_GIRQ_REGISTER*)(INTS_BASE + GPIO_GIRQ_X_OFFSET(pin))
                                               ^
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:52:6: note: in expansion of macro 'GPIO_GIRQ'
         (GPIO_GIRQ(pin))->GIRQ_SRC    = GPIO_GIRQ_BITMSK(pin);
          ^~~~~~~~~
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c: In function 'gpio_set':
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:27:55: error: 'GPIO_000_036_BASE' undeclared (first use in this function)
     #define GPIO_PIN_CONTROL        ((volatile uint32_t *)GPIO_000_036_BASE)
                                                           ^
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:59:9: note: in expansion of macro 'GPIO_PIN_CONTROL'
             GPIO_PIN_CONTROL[pin] |= (GPIO_PIN_CONTROL_ALTERNATE_GPIO_DATA_Msk);
             ^~~~~~~~~~~~~~~~
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c: In function 'gpio_get':
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:27:55: error: 'GPIO_000_036_BASE' undeclared (first use in this function)
     #define GPIO_PIN_CONTROL        ((volatile uint32_t *)GPIO_000_036_BASE)
                                                           ^
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:67:13: note: in expansion of macro 'GPIO_PIN_CONTROL'
         return (GPIO_PIN_CONTROL[pin] & GPIO_PIN_CONTROL_GPIO_INPUT_Msk)? 1:0;
                 ^~~~~~~~~~~~~~~~
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c: In function 'gpio_config':
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:27:55: error: 'GPIO_000_036_BASE' undeclared (first use in this function)
     #define GPIO_PIN_CONTROL        ((volatile uint32_t *)GPIO_000_036_BASE)
                                                           ^
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:77:5: note: in expansion of macro 'GPIO_PIN_CONTROL'
         GPIO_PIN_CONTROL[pin] = val;
         ^~~~~~~~~~~~~~~~
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c: In function 'gpio_config_get':
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:27:55: error: 'GPIO_000_036_BASE' undeclared (first use in this function)
     #define GPIO_PIN_CONTROL        ((volatile uint32_t *)GPIO_000_036_BASE)
                                                           ^
    ../Src/APP/framework/plib/cec1702/gpio/gpio.c:82:12: note: in expansion of macro 'GPIO_PIN_CONTROL'
         return GPIO_PIN_CONTROL[pin];
                ^~~~~~~~~~~~~~~~
    make[2]: *** [nbproject/Makefile-default.mk:1072: build/default/production/_ext/1975708022/gpio.o] Error 255
    make[2]: *** Waiting for unfinished jobs....
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c: In function 'cec_qmspi_init':
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c:36:5: error: 'QMSPI' undeclared (first use in this function)
         QMSPI->QMSPI_MODE_b.ACTIVATE = 1;
         ^~~~~
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c:36:5: note: each undeclared identifier is reported only once for each function it appears in
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c: In function 'qmspi_term':
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c:45:5: error: 'QMSPI' undeclared (first use in this function)
         QMSPI->QMSPI_MODE_b.ACTIVATE = 1;
         ^~~~~
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c: In function 'cec_qmspi_start':
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c:84:9: error: 'QMSPI' undeclared (first use in this function)
             QMSPI->QMSPI_MODE_b.CPOL      = 0;
             ^~~~~
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c: In function 'qmspi_stop':
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c:104:5: error: 'QMSPI' undeclared (first use in this function)
         QMSPI->QMSPI_CONTROL_b.CLOSE_TRANSFER_ENABLE = 1;
         ^~~~~
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c: In function 'qmspi_rw':
    ../Src/APP/framework/plib/cec1702/qmspi/qmspi.c:122:5: error: 'QMSPI' undeclared (first use in this function)
         QMSPI->QMSPI_CONTROL_b.TRANSFER_LENGTH = sz;    
         ^~~~~
    make[2]: *** [nbproject/Makefile-default.mk:1084: build/default/production/_ext/1126562121/qmspi.o] Error 255
    "/opt/microchip/xc32/v2.30/bin/xc32-gcc"    -g -x c -c -mprocessor=CEC1702  -ffunction-sections -Os -DDEVICE_MEC2016=1 -DETH_MODE -DDEMO_ALL -DDONT_USE_UPLOADTOBLOB -DREFCOUNT_ATOMIC_DONTCARE -DUSE_MBED_TLS -DUSE_PROV_MODULE -I"../Inc" -I"../Src/APP/framework" -I"../Src/APP/framework/azure/c-utility/inc" -I"../Src/APP/framework/azure/iothub_client/inc" -I"../Src/APP/framework/azure/umqtt/inc" -I"../Src/APP/framework/azure/parson" -I"../Src/APP/framework/driver/rando" -I"../Src/APP/framework/mbedTLS/include" -I"../Src/APP/config" -I"../Src/APP/platform/timer" -I"../Src/APP/platform/winc" -I"../Src/APP/framework/plib/cec1702" -I"../Src/APP/framework/azure/certs" -I"../Src/APP/framework/azure/dps_client/inc" -I"../Src/APP/framework/azure/dps_client/adapters" -I"../Src/RIoT/Inc" -I"../Src/RIoT/Inc/RiotCrypt" -I"../Src/APP/framework/azure" -I"../Src/include" -I"../Src/APP/apps" -I"../Src/CEC1702" -I"../Src/APP/framework/azure/provisioning_client/inc/" -I"../Src/APP/framework/azure/provisioning_client/adapters" -I"../Src/APP/framework/azure/deps/uhttp/inc" -I"../Src/APP/framework/azure/deps/parson" -I"../Src/APP/framework/common" -MP -MMD -MF "build/default/production/_ext/601367553/iothub_client_retry_control.o.d" -o build/default/production/_ext/601367553/iothub_client_retry_control.o ../Src/APP/framework/azure/iothub_client/src/iothub_client_retry_control.c    -DXPRJ_default=default      -mno-smart-io -mdfp="/opt/microchip/mplabx/v5.45/packs/Microchip/CEC_DFP/1.2.87/cec1702" -I "/opt/microchip/mplabx/v5.45/packs/arm/CMSIS/5.0.1/CMSIS/Include"
    ../Src/APP/framework/azure/provisioning_client/adapters/hsm_client_riot.c:17:18: fatal error: RIoT.h: No such file or directory
     #include "RIoT.h"
                      ^
    #4
    joaomorenorf
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2021/01/14 13:18:37
    • Location: 0
    • Status: offline
    Re: CEC1x02 Development Board - First Steps 2021/02/25 20:26:58 (permalink)
    0
    Hello Seb,
    I just want to update you. I have contacted Microchip support and they helped me to flash eFuse. They have sent me various projects and MEC_CEC_17xx_efuseGEN_release_08 worked, now I have my encryption keys recorded to eFuse!
    I moved to the next challenge: how to write encrypted and signed firmware to flash. I'll open another thread just to it, maybe someone maybe have stumbled across it and can share with me.
    Best regards joao.
    #5
    Jump to:
    © 2021 APG vNext Commercial Version 4.5