Announcement

Collapse
No announcement yet.

media_WriteByte causes crash on Picaso uLCD-32PT_GFX2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • media_WriteByte causes crash on Picaso uLCD-32PT_GFX2

    Hello
    I am trying to write bytes to flash but get error 16 when I attempt to write to flash.
    #platform "uLCD-32PT_GFX2"
    func main() var n, char; while (media_Init()==0); // wait if no SD card detected media_SetSector(0, 2); // at sector 2 while (n < 10) media_WriteByte(n++ +'0'); // this cause error 16 //media_WriteWord(n++ +'0'); // this is okay wend // first 10 locations. print("\n\rSUCCESS"); repeat foreverendfunc

    If I replace media_WriteByte with media_WriteWord no crash. Please advise if there's a limitation with Picaso. Are there issues with writing to a non word aligned address?

  • #2


    Syntax for media_WriteByte is:-
    func media_WriteByte("byte"), 1; // write a byte to the current stream position
    // Syntax: media_WriteByte(arg1);
    // Usage : var := media_WriteByte(arg1);
    // : After the write the Address pointer is automatically
    // : incremented by 1.

    It only takes 1 parameter.
    Regards,
    Dave

    Comment


    • #3


      Hi Dave. Thanks for your response.The example is extracted directly out of the documentation PICASO-GFX2-4DGL-Internal-Functions-rev2.pdf for media_WriteByte and compiles as 1 argument. The compiler should throw an error is this was not the case.
      If I use media_WriteByte('B') it also crashes with error 16

      Comment


      • #4


        Hmmm thats quite odd - error 16 is 'bad PmmC number'

        meaning the media_WriteByte function is not even recognized.

        What is the PmmC revision number and compiler version you are using?
        Regards,
        Dave

        Comment


        • #5


          I am using PmmC revision number v2.5 (uLCD-32PTGFX-R25.PmmC)I'm guessing the compiler version is tied to Workshop 3. I'm using Version 3.1.0.14
          I can send you the compiled code if that would help?

          Comment


          • #6


            I have the same issue with the media_WriteByte command. It crashes the board. My work around is the use the media_WriteWord command. It works as intended. This has to be used even when only writing a single byte.

            Jason

            Comment

            Working...
            X