Shop OBEX P1 Docs P2 Docs Learn Events
Help getting mini sd card to work — Parallax Forums

Help getting mini sd card to work

P!-RoP!-Ro Posts: 1,189
edited 2009-08-09 14:17 in Propeller 1
I'm having some trouble with the sd card. I ran sdrw test on the prop and I got the message "mounting. Returned from start -13." Also, when I ran this code:

·text.str(STRING("Starting Up",13))
··· i:=sd.mount(0)
· if (i<>0)
··· text.str(STRING("error",13))
··· repeat
· text.str(STRING("SD Card Mounted",13))

It would just freeze on the text "starting up." Is there something wrong with it? What should I do?
Also--I'm using a 4gb sdhc and the propmod-us_ps_sd. The fsrw program version is 1.6.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
«1

Comments

  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 02:46
    I believe you need FSRW 2.0 or greater for SDHC check out http://fsrw.hg.sourceforge.net/hgweb/fsrw/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 03:13
    Is there a better way of downloading it than copy and paste? Because when I do that it ads a lot of other things I don't want.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 04:00
    Since that was a poor site to download it from I had to do some looking around, but I found it and it worked. Thanks again mctriv.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • lonesocklonesock Posts: 917
    edited 2009-08-08 04:00
    Pi Guy said...
    Is there a better way of downloading it than copy and paste? Because when I do that it ads a lot of other things I don't want.
    I use TortoiseHg under Windows, works quite well. Also, on the sf.net Mercurial browser site mctrivia pointed you to, you can click on the "files" line, then there is a "raw" link next to the files you want. (And he is right, the older 1.6 release does not handle SDHC or FAT32, but the new version does. There are also various other implementations floating around on this forum.)

    Alternatively, just use the two files I'm attaching to this post! [noparse][[/noparse]8^)

    We're working on a release, but both Tom and I are a little busy. Sorry about the wait.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 04:01
    Sorry lonesock, google beat you to it. But thanks anyway.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 04:03
    BTW--the raw part doesn't work because it adds a lot of things like +, - and @.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 04:09
    by the way there is a card format called mini sd. you want micro sd

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 05:13
    alright smarty, now that i have my micro sd card working i'm running into some other problems like how to write stuff which is terribly hard. if u want u can give me pointers, or i'll probably just stay up til midnight reading through some code trying to figure it out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 05:16
    you can reduce your reading by using the documentation option in the propeller tool. i have not tried but i would assume it is backwards compatible with the older one so my examples i gave you should still work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 05:20
    I was looking at some of them, and I appreciate you pointing them out to me. I'm just wishing there were a few more comments on what happens so I could understand it better.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 05:26
    I added some stuff from the otp generator and tried this:
    num := 5
    i:=sd.pwrite(@num, 1)
    if (i<>0)
    term.str(string("busted", 13))
    repeat
    it gave me the message busted tho and i dnt know why

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 05:32
    pwrite uses a buffer nut an integer. a buffer is a group of bytes.

    try

    num := 5
    i:=sd.pputc(num)
    if (i<>0)
    term.str(string("busted", 13))
    repeat


    also are you mounting the disc and saving the file?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 05:32
    Wow I'm hopeless. I can weld, I can build robots, but I sure as heck don't know how to program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 05:33
    and thanks mctrivia for not giving up on me either!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 05:36
    you must use:

    sd.mount(0)
    sd.pclose

    commands

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 05:39
    I know, I didn't show that part. I haven't been using pclose though, just shutting off power. is that a problem? btw--i got 5 finally

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 05:40
    if you don't use pclose nothing is writen to card. fsrw buffers the info to speed things up.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 05:46
    I'll remember that when I program my robot and scratch my head after a reset because nothing is there anymore.

    to the point--I think I'm getting a hang of things a little here, with putc placing one variable and getc retrieving it when the pointer is located on the spot, but how can I move that pointer? For instance, say the number saved is 1234. is there a way to move the pointer over 3 so when i use getc i get the number 3?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 05:55
    if that small just read in the block using pread which can read multiple bytes at a time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 06:02
    I feel bad throwing all these questions but I've been staring at that one for a while and can't figure out what ubuf is supposed to be. If you have a program that uses this I'm sure I could look at it and figure out what it is but right now I'm really unsure. Maybe it will be easier after I had my midnight snack...or perhaps some sleep instead. Thanks for helping me out so far mctriv.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 06:04
    otp uses it. i have two buffers called rand0 and rand1

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 06:12
    helpful again, man I swear i will put u on the list for one of the my top contributors everytime i make a vid or write a webpage about my robot or gg project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 06:15
    i am just glad i can help. i am sure some day you will be in the situation to help someone else also.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 06:21
    I probably will, soon. When school starts I am going to try my best to start a robotics club with donated BOE Bots from Parallax. I tried to do it last year, but I didn't get started until too late to make much progress. One good thing about it though is I at least know PBAISIC. Anyway, I'm about ready to fall over I'm so tired. I'll try out that pread in the morning and hopefully I'll have some luck. ttyl

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-08 12:50
    Pi Guy said...
    Wow I'm hopeless. I can weld, I can build robots, but I sure as heck don't know how to program.

    Same here! :-)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.



    If it's not Parallax then don't even bother. :-)
    ·
    I have changed my avatar so that I will no longer be confused with others who use genaric avatars.

    Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
    Cheap·shipping unless specified!··········150 left!!··




  • lonesocklonesock Posts: 917
    edited 2009-08-08 14:38
    Pi Guy said...
    BTW--the raw part doesn't work because it adds a lot of things like +, - and @.
    Hmm, bummer. I guess "it works for me" doesn't help any wink.gif

    As one other code example, here is the link to a simple serial terminal app, showing off multiple file access and things like that. Hopefully it is of some use.

    fsrw.hg.sourceforge.net/hgweb/fsrw/raw-file/caa4f46fdf89/serial_terminal.spin

    Check out the execute_command routine. It has examples for file copying and reading the directory, etc.

    Good luck on your project!

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 17:24
    @micro--im glad im not alone
    @jon--i've been going through that code trying to understand it, but it's probably gunna take a lot of coffee to stay focussed

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 17:43
    when I use this:
    sd.pread( @numret, 4)
    I'm only getting one number back which is 5, and I'm supposed to get 56. what am I doing wrong here?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • mctriviamctrivia Posts: 3,772
    edited 2009-08-08 18:17
    Post your decleration code for numret

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-08 21:34
    byte numret
    I tried changing byte to long and I got
    100992516

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG

Sign In or Register to comment.