Author Topic: noob question about mass_storage_write.c  (Read 11244 times)

Martin

  • Member
  • ***
  • Posts: 5
noob question about mass_storage_write.c
« on: July 08, 2014, 02:13:59 am »
Hi All.
I’ve recently purchased the book USB embedded hosts, and I’m working through the pages slowly. As I can’t afford a Beagle board I’m trying to use my Ubuntu installation instead. I know Jan wrote that she used VMWare to run Linux in Windows, but I’m hoping it will work.
Needless to say I have struck a problem with the mass_storage_write.c because the ,
      if (drive_available(drive_mount_point))
      {
.
.
.
}
fails and prints out  the allocated error message. When I attempt to print out the (mount_point_and_file) string contents I simply get (/my_data.txt), even though I have a drive installed and I can read and write to it.

I can start my normal debugging attempts but before I end up wasting a lot of time, my question is,… can I do all or most of the work within Ubuntu or am I doomed to constantly run into problems. BTW if you haven’t already noticed I’m a Windows user,… Sorry :)
m.b

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: noob question about mass_storage_write.c
« Reply #1 on: July 08, 2014, 10:49:29 am »
If you're asking if the example code in USB Embedded Hosts will work in Ubuntu, yes, I tested all of the code running Ubuntu on the BeagleBoard.

If you can provide the error message you're seeing, we may be able to help.

Martin

  • Member
  • ***
  • Posts: 5
Re: noob question about mass_storage_write.c
« Reply #2 on: July 08, 2014, 06:29:01 pm »
Hi Jan, yes that’s what I wanted to know. Looking through each step in the example more closely, and also as you write in chapter5,.. I found the entry in /proc/mounts file was different than "dev/sda". The entry in the file loaded on my machine was "dev/sdb1", after changing this, it all worked.

cheers

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: noob question about mass_storage_write.c
« Reply #3 on: July 08, 2014, 09:48:13 pm »
Excellent!