#avr | Logs for 2016-09-28

Back
[14:40:37] <carabia> Yeah I'm gonna give up on fatfs really soon.
[14:41:17] <bss36504> Is not having relative paths such a dealbreaker that you'd discard an otherwise sound library? Also, I suspect the issue doesnt come from within fatfs itself
[14:41:44] <carabia> I have my own fat32-driver that's super simplified (streamed read, lfns) but doesn't do writing, and I kind of needed that.
[14:41:50] <carabia> Well, yeah it kind of is
[14:42:46] <bss36504> Why though?
[14:43:07] <carabia> as I'll be reading a directory with undefined structure so it needs to be dynamic. I could do string concatting but it's just stupid.
[14:43:28] <bss36504> Well I dont think it's /that/ stupid
[14:43:47] <carabia> my own driver is way leaner than this. As I already ran into trouble trying to do this I'm sure I'll just dig a deeper hole for myself going deeper
[14:50:27] <bss36504> Are you sure res is good for chdir, opendir and readdir?
[14:50:51] <carabia> positive
[14:52:12] <bss36504> What is your _USE_LFN set to?
[14:53:00] <bss36504> If it is non-zero, what is _MAX_LFN set to?
[14:53:00] <carabia> 3
[14:53:04] <carabia> 255
[14:53:13] <bss36504> ok well that seems fine then...
[14:53:54] <carabia> tried with + without lfn, no diff.
[14:54:03] <bss36504> Are all the fields in the FILINFO struct borked?
[14:54:07] <bss36504> or just the name?
[14:55:40] <carabia> let me check
[14:56:49] <carabia> yeeeh, borked.
[14:57:12] <carabia> at least the size if >4 billion so ye
[14:57:20] <carabia> s/if/is
[14:57:44] <carabia> the file i'm opening is a few hundred bytes
[14:58:04] <carabia> well, the file of which entry it's reading
[14:58:09] <carabia> /supposedly/
[15:00:23] <carabia> hang on, i'm gonna take a walk on the wild side...
[15:00:27] <bss36504> Dont directories have a fixed size of 4K?
[15:00:40] <bss36504> like if I ls -l on linux, dirs show size of 4K
[15:01:02] <bss36504> I guess not 4 billion though
[15:01:03] <carabia> well, in any case the size field is fucked.
[15:01:23] <carabia> afaik the readdir should return the filesize if the item it read indeed is a file
[15:01:30] <carabia> well, not return but set it in the object
[15:01:53] <bss36504> What if, just for shits and gigs, you tossed a simple text file in the in the directory, and tried chdir then f_opening that file with the relative path?
[15:02:40] <carabia> worth a shot, sec
[15:03:18] <bss36504> It might at least rule if it's an issue with the opendir vs relative path
[15:03:26] <mangul> this is atmel avr?
[15:03:32] <bss36504> yeah
[15:04:22] <mangul> wow
[15:04:46] <mangul> i didnt know it has an irc channel?
[15:05:04] <bss36504> Oh yeah, we've been here a while
[15:05:23] <bss36504> I think it was here years before I was, and I joined 4 years ago I think
[15:07:53] <carabia> bss36504: nope, the FIL-struct gets populated with garbage
[15:08:16] <mangul> how do i program my atmega8?
[15:08:21] <carabia> let me try something however...
[15:09:39] <bss36504> mangul: That's a broad question. Do you mean how to write and compile code for it? Do you mean how do you get that compiled code onto the micro?
[15:10:51] <bss36504> For the former: Atmel has their (windows only) IDE, based on Visual Studio, called Atmel Studio. I quite like it. It is backed by the avr-gcc toolchain which is quite mature and works pretty well. AS also supports a number of programmers and debuggers, which interface with your micro and load code onto it for you.
[15:11:19] <bss36504> You could also just write code in a text editor, compile it with avr-gcc and use a tool like avrdude with some programmer to load it onto your chip
[15:12:02] <bss36504> I prefer and really only have experience with Atmel Studio, but I find it works pretty well. Tons of people have had great luck and productivity with avrdude as well. In fact, avrdude is used by the arduino IDE if I'm not mistaken
[15:13:16] <bss36504> carabia: Well that would certainly point to something fucky with how the relative paths are maintained. That sucks.
[17:01:09] <carabia> bss36504: I actually pulled the most recent fatfs now from the site (0.12b or something), as the earlier one was bundled with something else and was an older version (0.11)
[17:01:57] <carabia> First thing I ran into with this is that the fucker removed cp1252... I guess I can just take a stab at the character table and put it there myself. I hope it doesn't do any additional checks.
[23:23:05] <dgriffi> sabor: I've got my attiny85 making a good approximation of a sine wave. Thanks!
[23:58:28] <carabia> bss36504: alright, amazing progress. After too many hours of debugging I've gotten it to actually read something off a file.
[23:59:19] <carabia> Though when I'm using the unicode switch for lfns the mcu hardfaults... I guess the stack's overflowing somewhere but I'm getting really god damn tired of debugging this