Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 25 May 2018 12:36 PM by  Philippe Racine
new SOMOMAPL138-10-1603QHIR
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Philippe Racine
New Member
New Member
Posts:2


--
24 May 2018 03:19 PM

    Hi,

    We are using the SOMOMAPL138-10-1602QHIR for years. Now it is obsolete and the replacement is SOMOMAPL138-10-1603QHIR.

    I am really not a pro when it is time to go deeper in parameters, libraries or configurations.

    We received our first new device SOMOMAPL138-10-1603QHIR this week.

    We try the new device the same way we are doing usually :

    • We plug the OMAP-L138 SOM-M1 on our PCB.
    • We power up the PCB.
    • We connect the USB cable between the PCB and the computer.
    • We open Code Composer Studio and launch our project.

    Everything seems ok except one thing at the moment.

    the function SPIFLASH_init(); failed. The ID is not ok.

    Before the ID return was :

    • spi_data rx:    FF 20 20 17

    Now we have :

    • spi_data rx:    FF 20 BA 18

     

    The 20 20 17 are #define in spiflash_numonyx.c

     

    Does someone have an idea of what I have to do to make the SpiFlash works like before with the new device?

    Is it a parameter in the project?

    Do I have to dowload an updated library?

    I am a little lost at the moment.

     

    Thank you,

     

    Philippe

    bradb
    Basic Member
    Basic Member
    Posts:203


    --
    24 May 2018 04:28 PM

    Philippe,

    All you should have to do is change the ID to match the new SPI flash.  

    The link below documents the change to the new model in PCN 623.

    11/28/2017 OMAP-L138 SOM-M1 Product Change Notification pdf Rev H 542 Kb

     

    Outside changing the expected ID, no other software changes are expected.

    Thanks,

    Brad

    Philippe Racine
    New Member
    New Member
    Posts:2


    --
    25 May 2018 12:36 PM

    Thank you for your comment.

    I found the project for this .lib and I changed the ID.

    Of course, it works ! But we use the MAC address as the unique ID and the MAC address I was reading was wrong. After a quick look, I saw the MAC address was read at the end of the memory.

    So in spiflash_numonyx.h

    After

    #define NUMONYX_M25P64_SIZE         (8388608)

    I added

    #define NUMONYX_MT25QL128ABA1EW9_SIZE         (16777216)


    And I changed

    #define SPIFLASH_CHIP_SIZE          (NUMONYX_M25P64_SIZE)

    to

    #define SPIFLASH_CHIP_SIZE          (NUMONYX_MT25QL128ABA1EW9_SIZE)

     

    At this point I was able to read the MAC address and everything else was working like usual.

     

    The only think was kill me, from this point I will need to have two versions of code. If I want to upgrade an older device, I will need to know what version of SOM I had in the device...

     

    To make thing simple, I decided to replace the #define by a variable.

    So now, in spiflash_numonyx.h SPIFLASH_CHIP_SIZE is not a #define anymore.

    extern uint32_t SPIFLASH_CHIP_SIZE;

     

    In spiflash_numonyx.c is initialized like that :

    uint32_t SPIFLASH_CHIP_SIZE = NUMONYX_M25P64_SIZE;

     

    In function uint32_t NUMONYX_verifyDeviceID(void)

    I code this :


       if ((spi_data[1] != NUMONYX_MFR_ID) ||
             (spi_data[2] != NUMONYX_DEV_ID_TYPE) ||
             (spi_data[3] != NUMONYX_DEV_ID_CAP))
       {

           if ((spi_data[1] != NUMONYX_MFR_ID2) ||
                 (spi_data[2] != NUMONYX_DEV_ID_TYPE2) ||
                 (spi_data[3] != NUMONYX_DEV_ID_CAP2))
           {
                #ifdef DEBUG
                printf("spi flash id does not match expected id!\r\n");
                #endif
                return (ERR_FAIL);
           }
           else
           {
                SPIFLASH_CHIP_SIZE = NUMONYX_MT25QL128ABA1EW9_SIZE;
                #ifdef DEBUG
                printf("spi flash is MT25QL128ABA1EW9 (16mb)!\r\n");
                #endif
           }
       }
       else
       {
               SPIFLASH_CHIP_SIZE = NUMONYX_M25P64_SIZE;
            #ifdef DEBUG
            printf("spi flash is M25P64 (8mb)!\r\n");
            #endif
       }

     

    Where

    NUMONYX_MFR_ID2, NUMONYX_DEV_ID_TYPE2 and NUMONYX_DEV_ID_CAP2 are the new ID

    #define NUMONYX_MFR_ID2             (0x20)
    #define NUMONYX_DEV_ID_TYPE2        (0xBA)
    #define NUMONYX_DEV_ID_CAP2         (0x18)

     

    I didn't go deeper in my tests but for now everything looks fine. I can read and write in the memory and the MAC address is ok for both version of the SOM-M1.

     

    Thanks,

     

    Philippe

     

    You are not authorized to post a reply.