Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#191029 - 28/11/2003 21:19 Dumb & Dumber: 2 Dumb Questions..
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia
Okay, while doing the 2nd drive upgrade on my Empeg today, I got hit by two questions...

1. How come, everytime the player adds swapspace, it adds a priority? i.e.:
In reply to:


Adding Swap: 16028k swap-space (priority -3)
....then...
Adding Swap: 16028k swap-space (priority -4)
...then...
Adding Swap: 16028k swap-space (priority -5)



Very strange.. or so I think...

2. If the player detects when "power is lost" and writes into to the flash-save area, why dosn't the player write to the flash-save area after every song? That way, if it ever fails upon loss-of-juice, you're never more than a song behind (or in a completely different playlist, like I found myself the other day..)

Me.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#191030 - 28/11/2003 22:51 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: foxtrot_xray]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
1) Highest priority is the first swap device used. Each one you add will be used after the previous one.

2) The flash has a finite number of cycles before it's useless.

Top
#191031 - 04/12/2003 18:05 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: Daria]
FireFox31
pooh-bah

Registered: 19/09/2002
Posts: 2494
Loc: East Coast, USA
So, then we have a finite number of times we can power the unit off?

If so, is there a user-enabled way to replace this flash thing?
_________________________
-
FireFox31
110gig MKIIa (30+80), Eutronix lights, 32 meg stacked RAM, Filener orange gel lens, Greenlights Lit Buttons green set

Top
#191032 - 04/12/2003 18:19 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: FireFox31]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Yeah. There's a limited number of times you can yank it out and make it write to flash. It only writes to flash on powerfail.

You're not going to go anywhere near this limit unless you sit there inserting and removing the empeg about 6,400,000 times or if you reflash the kernel around 100,000 times.
* To ensure consistency, each block is written with a CRC (126 bytes
* of data, 2 byte CRC) so that on powerup, the software searches the
* flash memory for the latest (ie, highest address) block with a
* correct CRC, and copies this into the ram buffer. It then looks for
* the first 100% blank (all 0xffff) page in which it will store the
* updated information at the next powerfail. If no such block exist,
* an erase page command is issued. Since the flash page is 8k long,
* we only need to erase the page after 64 powerfails. As the flash
* is rated at 100,000 erase cycles, this means the flash will give
* out after 6,400,000 powerfails
You can replace the flash chip if you're good at SMD rework. You'll also need to program the protected bootloader as well. In other words, no it's not that trivial to replace and if you had to ask then you probably shouldn't do it

Top
#191033 - 04/12/2003 19:49 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: tman]
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia
Interesting question.. I have a friend who can, and has done, SMT work for me before. Say IF I get a chip (anyone know what chip it is?), and coule re-install it to the board, how would the protected boot-loader get flashed on? The only way I can think is direct hardware access to the chip..

(Or, alternatively, make it start writing to the HD.. Sure, there would be possible problems.. Maybe the MBA record or something?)

I'm not too worried, tho. 6+million times ain't bad.
Me.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#191034 - 04/12/2003 20:01 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: foxtrot_xray]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
You'd need to write the bootloader onto the chip using some external programmer. The empeg itself could do it (after you connect the write enable for the boot block) but you can't boot it without the bootloader...

The reason why it's using the flash is that you've got very limited amounts of power available once it's detected a power fail. You definately don't have enough to keep the drive spinning and then write to it.

The relevant comment in the empeg state driver is:
* This driver handles the emergency flash programming system used by
* the empeg. Periodically the player will write 128 bytes of memory
* to this driver. When the power fails this block is written to flash
* using an algorithm described below. The powerfail interrupt is
* triggered when the input voltage to the PSUs falls below around
* 10 volts - we have a bit of time due to the capacitors on the PSU
* keeping us going!
You should be safe anyway, 6 million or so writes is plenty! (Not the same as 640k is plenty though )

Top
#191035 - 05/12/2003 11:04 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: tman]
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia

The reason why it's using the flash is that you've got very limited amounts of power available once it's detected a power fail. You definately don't have enough to keep the drive spinning and then write to it.

Ah. Tha'ts me. Missing the obvious.


(Not the same as 640k is plenty though)

640k? Hell. 64k was enough for me in my C=64!

Thanks!
Me.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#191036 - 05/12/2003 11:10 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: foxtrot_xray]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
64k? I'd kill for 64k! I'm writing some stuff for a microprocessor and it's only got 256 bytes. It's kind of interesting trying to wedge a TCP/IP stack into that whilst still having enough left over to actually run the everything else.

Top
#191037 - 05/12/2003 11:16 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: tman]
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia

64k? I'd kill for 64k! I'm writing some stuff for a microprocessor and it's only got 256 bytes. It's kind of interesting trying to wedge a TCP/IP stack into that whilst still having enough left over to actually run the everything else.

I'm impressed. I wish I could program one of those BASIC stamp-type things, or an EEPROM for a 080 processor. I have many uses that I could use for things like that.. I may learn, someday, once I retire in 50 years.

Me.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#191038 - 07/12/2003 12:17 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: tman]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Trev, the stuff you're quoting from, is it a post on the board or a document? I'd love to read the rest of it.
_________________________
Cheers,

Andy M

Top
#191039 - 07/12/2003 12:37 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: andym]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
It's out of the kernel source. Untar it and look in arch/arm/special. All of the interesting stuff for the empeg is kept in there. The bits I've quoted are from empeg_state.c which does all of the stuff regarding the flash.

Top
#191040 - 08/12/2003 03:30 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: tman]
julf
veteran

Registered: 01/10/2001
Posts: 1307
Loc: Amsterdam, The Netherlands
64k? I'd kill for 64k! I'm writing some stuff for a microprocessor and it's only got 256 bytes. It's kind of interesting trying to wedge a TCP/IP stack into that whilst still having enough left over to actually run the everything else.

Have you looked at OpenTCP?

Top
#191041 - 08/12/2003 04:36 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: julf]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Yup. I looked at it originally and got worried by the system requirements . I've written my own stack anyway now and it seems to be working okay. I did manage to get an extra kb of RAM by using a bit off the end of the NIC buffers. The RTL8019 is probably one of the worst documented chips ever. It's Yet-Another-ISA-NE2000-Clone and just says go look at the NE2K docs for the specs BUT we change this and this and this on so and so page.

Top
#191042 - 08/12/2003 04:47 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: tman]
julf
veteran

Registered: 01/10/2001
Posts: 1307
Loc: Amsterdam, The Netherlands
OK, there are just some interesting protocol simplifications in the opentcp code that you might like to copy. Just features left out (such as fragmentation).

Top
#191043 - 08/12/2003 04:51 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: julf]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Yeah. If I did it again then I'd use the OpenTCP stack. At the time however, I didn't have that extra kb out of the buffers so wedging it all into 256 bytes seemed a little insane. It's a Cypress Micro PSoC and it only has 256 bytes of RAM and 16KB of EEPROM to store everything else. It's not the most powerful of platforms

Top
#191044 - 08/12/2003 07:16 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: tman]
julf
veteran

Registered: 01/10/2001
Posts: 1307
Loc: Amsterdam, The Netherlands
it only has 256 bytes of RAM and 16KB of EEPROM

Well, my first "computer" had 256 bytes of RAM (2 chips!) and 4K of ROM. And a slightly anemic 1-MHz 6800.

Top
#191045 - 08/12/2003 07:39 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: julf]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Well. In my day, we had to walk 10 miles in snow up hill to even get 1 bit of RAM... Only joking For some odd reason, I've got a core memory PCB. I think it's something my uncle gave me. It's an amazing 32 bytes and physically massive.

It's a good point though. I really shouldn't complain about lack of resources considering it wasn't that many years ago when what I've got now would be pretty powerful. The PSoC does run at a more respectable 24MHz though

Top
#191046 - 08/12/2003 08:05 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: tman]
julf
veteran

Registered: 01/10/2001
Posts: 1307
Loc: Amsterdam, The Netherlands
I've got a core memory PCB. I think it's something my uncle gave me. It's an amazing 32 bytes and physically massive.

Yes, pretty impressive stuff. And I understand NASA used that stuff fairly recently on manned flights, because it's so much more immune to alpha particles than semiconductor RAM.

The really fun stuff is core PROM. You program it by physically threading a third wire into the bits you want to be 1's...

Top
#191047 - 08/12/2003 13:10 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: tman]
johnmcd3
enthusiast

Registered: 19/04/2001
Posts: 369
Loc: Seattle, WA (formerly Houston,...
If I did it again then I'd use the OpenTCP stack
What do you think of uIP? I'm using that for a project on one of those preassembled Packet Whacker boards.

John
_________________________
1998 BMW ///M3 30 GB Mk2a, Tuner, and 10 GB backup

Top
#191048 - 08/12/2003 13:59 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: johnmcd3]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Yeah. It's pretty good. I'm actually using one of the packet whacker boards until I get a PCB made up. Soldering individual leads to the RTL chip isn't fun

Are you emulating the 93C46 or using a real one?


Edited by tman (08/12/2003 13:59)

Top
#191049 - 11/12/2003 11:43 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: tman]
johnmcd3
enthusiast

Registered: 19/04/2001
Posts: 369
Loc: Seattle, WA (formerly Houston,...
Are you emulating the 93C46 or using a real one?
I'm actually using the one that comes with an Atmel Atmega16 microcomputer which has EEPROM builtin.

I won't actually be geeting deep into the project until next week when finals are over, though.

John
_________________________
1998 BMW ///M3 30 GB Mk2a, Tuner, and 10 GB backup

Top
#191050 - 12/12/2003 13:16 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: johnmcd3]
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia

Are you emulating the 93C46 or using a real one?


I'm actually using the one that comes with an Atmel Atmega16 microcomputer which has EEPROM builtin.


Stop, stop! You guiys are hurting my brain!

Me.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#191051 - 18/12/2003 00:49 Re: Dumb & Dumber: 2 Dumb Questions.. [Re: johnmcd3]
johnmcd3
enthusiast

Registered: 19/04/2001
Posts: 369
Loc: Seattle, WA (formerly Houston,...
Are you emulating the 93C46 or using a real one?
I'm actually using the one that comes with an Atmel Atmega16 microcomputer which has EEPROM builtin.
Diving into the datasheets tonight, I realized a made a naïve (and incorrect) assumption about what you were asking earlier.

I’m planning on using the RTL8019AS in jumper mode, which (as far as I can see) means that I don’t need to mess with using or emulating the 9346.

I’m not at all an expert with this stuff-- this project is the biggest embedded project I’ve ever undertaken (deploying some data aquisition units over Ethernet for my university). We’ll have to see how it goes…

John
_________________________
1998 BMW ///M3 30 GB Mk2a, Tuner, and 10 GB backup

Top