Coder Social home page Coder Social logo

Comments (3)

Crazy-Geeks avatar Crazy-Geeks commented on June 18, 2024

@fresird, Thanks for notice

from stm32-w25q-qspi.

fresird avatar fresird commented on June 18, 2024

Hi @Crazy-Geeks , Thanks you for your great W25Q library.
I find if I write 256 bytes with pageShift == 0, W25Q_ProgramData return W25Q_PARAM_ERR.
I changed 255 to 256, and It works very well.
W25Q_STATE W25Q_ProgramData(uint8_t* buf, uint16_t len, uint8_t pageShift, uint32_t pageNum)
{
/*
if (pageNum >= PAGE_COUNT || len == 0 || len > 256 || pageShift > 255 - len
|| (pageShift > 0 && pageNum >= PAGE_COUNT - 1))
return W25Q_PARAM_ERR;
*/
if (pageNum >= PAGE_COUNT || len == 0 || len > 256 || pageShift > 256 - len
|| (pageShift > 0 && pageNum >= PAGE_COUNT - 1))
return W25Q_PARAM_ERR;
uint32_t rawAddr = page_to_addr(pageNum, pageShift);
return W25Q_ProgramRaw(buf, len, rawAddr);
}

from stm32-w25q-qspi.

Crazy-Geeks avatar Crazy-Geeks commented on June 18, 2024

@fresird I haven't tested it well, so I've missed this error, I'll fix this.
If you find bugs later - create pull request, please

from stm32-w25q-qspi.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.