This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52840 uint64_t problem

I have one problem with unsing uint64_t in application...

Im for test try simple demo:

uint64_t test = 1327644190303473294;
NRF_LOG_INFO("test: %"PRIX64"\n", test);

But I receive in RTT Viewer output:

 0> APP:INFO:test: 0

What Im doing wrong? Thanks for any help :)

Parents
  • Something still doesn't work ok:

    uint64_t test = 7340861779410949837;
    NRF_LOG_INFO("test: %llu\n", test);
    NRF_LOG_FLUSH();
    

    Produce:

     0> APP:INFO:test: 47549582942412
    

    I will check project settings...

    P.S. If I disable MicroLib I get:

    0> APP:INFO:test: 319297229
    

    This is if I convert uint64 to 2xuint32 by calculator on pc one of int32 ...

    If I change Optimization from Level 3 to Level 0 result is same...

Reply
  • Something still doesn't work ok:

    uint64_t test = 7340861779410949837;
    NRF_LOG_INFO("test: %llu\n", test);
    NRF_LOG_FLUSH();
    

    Produce:

     0> APP:INFO:test: 47549582942412
    

    I will check project settings...

    P.S. If I disable MicroLib I get:

    0> APP:INFO:test: 319297229
    

    This is if I convert uint64 to 2xuint32 by calculator on pc one of int32 ...

    If I change Optimization from Level 3 to Level 0 result is same...

Children
Related