Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 646997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:40:28+00:00 2026-05-13T21:40:28+00:00

I am working on the Firmware for an embedded USB project. The production programmer

  • 0

I am working on the Firmware for an embedded USB project. The production programmer I would like to use automatically writes the Serial Number into the device flash memory at a specified memory address. The programmer stores the serial number as Hex digits in a specified number of bytes. For example, if I tell it to store the serial number 123456 at address 0x3C00 my memory looks like this:

0x3C00  -  00
0x3C01  -  01
0x3C02  -  E2
0x3C03  -  40
//(123456 in Hex = 1E240)

The problem is, when my host application reads the serial number from the device it is looking for a unicode char array. So my serial number should be …

{ '1','0',
  '2','0',
  '3','0',
  '4','0',
  '5','0',
  '6','0'}

When the

So in my firmware, which I’m writing in C, is it possible to retrieve the hex serial number from flash, encode it into a unicode char array and store it in a variable in Ram?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:40:28+00:00Added an answer on May 13, 2026 at 9:40 pm

    If the serial number fits into 32 bits and the platform is big endian and supports Unicode, 32 bit ints and the standard C libraries then this is pretty straightforward as other answers have shown. If the platform has 32 bit ints and 8 bit chars but is little endian and/or doesn’t support Unicode, and if the serial number can vary in length, then the below may be useful, though it’s a little workmanlike.

    void extract_serial_number(unsigned char* address, unsigned int bytes, char* buffer) {
        unsigned int value = 0;
        char c, *start = buffer;
        while (bytes--) {                      /* read the serial number into an integer */
            value = value << 8;
            value |= *address++;
        }
        while (value > 0) {                    /* convert to 16 bit Unicode (reversed) */
            *buffer++ = '0' + value % 10;
            *buffer++ = '\0';
            value /= 10;
        }
        *buffer++ = '\0';
        *buffer++ = '\0';
        buffer -= 4;
        while (buffer > start) {               /* reverse the string */
            c = *buffer;
            *buffer = *start;
            *start = c;
            buffer -= 2;
            start += 2;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 315k
  • Answers 315k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer char firstLetter = someString.charAt(0); String oneLetter = String.valueOf(someChar); You find… May 13, 2026 at 11:15 pm
  • Editorial Team
    Editorial Team added an answer PIMPL is a way of hiding the implementation, primarily to… May 13, 2026 at 11:15 pm
  • Editorial Team
    Editorial Team added an answer If the files "annoy" you because they contain sensitive information,… May 13, 2026 at 11:15 pm

Related Questions

INFO: I am working with Microsoft SQL. Ok the title is confusing but here
I am working on the issue of testing my GUI and I am not
I am working on the admin section of a new rails app and i'm
I am working on the billing component of a Ruby on Rails application using
I am working on the I18n of our java application and we have decided

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.